             return
         }
         
+        _updateIlluminationMode(flashMode)
+        
         sessionQueue.async(execute: {
             let stillImageOutput = self._getStillImageOutput()
             if let connection = stillImageOutput.connection(with: AVMediaType.video),

                self._setupOutputMode(self.cameraOutputMode, oldCameraOutputMode: nil)
                self._setupPreviewLayer()
                validCaptureSession.commitConfiguration()
                self._updateFlashMode(self.flashMode)
                self._updateCameraQualityMode(self.cameraOutputQuality)
                validCaptureSession.startRunning()
                self._startFollowingDeviceOrientation()

        }
    }
    
    fileprivate func _updateIlluminationMode(_ mode: CameraFlashMode) {
        if (cameraOutputMode != .stillImage) {
            _updateTorch(mode)
        } else {
            _updateFlash(mode)
        }
    }
    
    fileprivate func _updateTorch(_ torchMode: CameraFlashMode) {
        captureSession?.beginConfiguration()
        defer { captureSession?.commitConfiguration() }
        for captureDevice in AVCaptureDevice.videoDevices  {
            guard let avTorchMode = AVCaptureDevice.TorchMode(rawValue: flashMode.rawValue) else { continue }
            if captureDevice.isTorchModeSupported(avTorchMode) && cameraDevice == .back {
                do {
                    try captureDevice.lockForConfiguration()
                } catch {
                    return
                }
                
                captureDevice.torchMode = avTorchMode
                captureDevice.unlockForConfiguration()
            }
        }
    }
    
    fileprivate func _updateFlash(_ flashMode: CameraFlashMode) {
        captureSession?.beginConfiguration()
        defer { captureSession?.commitConfiguration() }
        for captureDevice in AVCaptureDevice.videoDevices  {
            guard let avFlashMode = AVCaptureDevice.FlashMode(rawValue: flashMode.rawValue) else { continue }
            if captureDevice.isFlashModeSupported(avFlashMode) && cameraDevice == .back  {
                do {
                    try captureDevice.lockForConfiguration()
                } catch {
                    return
                }
                
                captureDevice.flashMode = avFlashMode
                captureDevice.unlockForConfiguration()
            }
        }
    }
    
    fileprivate func _performShutterAnimation(_ completion: (() -> Void)?) {
