         
     }
     
-    private func updateForFocusPoint() {
-        
-        self.frontCameraDeviceInput?.device.focusPointOfInterest = self.focusPoint
-        self.backCameraDeviceInput?.device.focusPointOfInterest = self.focusPoint
+    private func updateForFocusPoint() throws {
+        
+        guard let frontCameraDeviceInput = self.frontCameraDeviceInput else { return }
+        guard let backCameraDeviceInput = self.backCameraDeviceInput else { return }
+        
+        try frontCameraDeviceInput.device.lockForConfiguration()
+        try backCameraDeviceInput.device.lockForConfiguration()
+        
+        if frontCameraDeviceInput.device.isFocusPointOfInterestSupported {
+            frontCameraDeviceInput.device.focusPointOfInterest = self.focusPoint
+        }
+        
+        if backCameraDeviceInput.device.isFocusPointOfInterestSupported {
+            backCameraDeviceInput.device.focusPointOfInterest = self.focusPoint
+        }
+        
+        frontCameraDeviceInput.device.unlockForConfiguration()
+        backCameraDeviceInput.device.unlockForConfiguration()
         
     }
     

        self.captureSession = AVCaptureSession()
        self.captureSession?.sessionPreset = AVCaptureSessionPresetPhoto
        updateForCameraType()
        updateForFocusPoint()
        
        //Photo output
        self.photoOutput = AVCapturePhotoOutput()

        
        didSet {
            
            try? updateForFocusPoint()
            
        }
        
