             self.response = response
             
             dispatch_async(dispatch_get_main_queue()) {
-                self.picker = UIImagePickerController()
-                self.picker!.delegate = self
-                self.picker!.sourceType = .Camera
-                self.picker!.cameraCaptureMode = .Photo
+                let picker = UIImagePickerController()
+                picker.delegate = self
+                picker.sourceType = .Camera
+                picker.cameraCaptureMode = .Photo
                 
                 // set overlay
                 if let overlay = request.query["overlay"] where overlay.count == 1 {
                     print(["BRCameraPlugin] overlay = \(overlay)"])
                     let screenBounds = UIScreen.mainScreen().bounds
                     if overlay[0] == "id" {
-                        self.picker!.showsCameraControls = false
-                        self.picker!.allowsEditing = false
-                        self.picker!.hidesBarsOnTap = true
-                        self.picker!.navigationBarHidden = true
+                        picker.showsCameraControls = false
+                        picker.allowsEditing = false
+                        picker.hidesBarsOnTap = true
+                        picker.navigationBarHidden = true
                         
                         let overlay = IDCameraOverlay(frame: screenBounds)
                         overlay.delegate = self
                         overlay.backgroundColor = UIColor.clearColor()
-                        self.picker!.cameraOverlayView = overlay
+                        picker.cameraOverlayView = overlay
                     }
                 }
-                
-                self.controller.presentViewController(self.picker!, animated: true, completion: nil)
+                self.picker = picker
+                self.controller.presentViewController(picker, animated: true, completion: nil)
             }
             
             return response

import Foundation

@available(iOS 8.0, *)
@objc public class BRCameraPlugin: NSObject, BRHTTPRouterPlugin, UIImagePickerControllerDelegate, UINavigationControllerDelegate, CameraOverlayDelegate {
    
    let controller: UIViewController
    var response: BRHTTPResponse?

                }
                let id = try self.writeImage(img)
                print(["[BRCameraPlugin] wrote image to \(id)"])
                resp.provide(200, json: ["id": id])
            } catch let e {
                print("[BRCameraPlugin] error writing image: \(e)")
                resp.provide(500)
