         }
         set {
             self.executeClosureAsyncOnSessionQueueIfNecessary {
-                if let device = self._currentDevice {
-                    guard
-                        device.torchMode != newValue,
-                        device.hasTorch
-                        else {
-                            return
-                    }
-                    
-                    do {
-                        try device.lockForConfiguration()
-                        if device.isTorchModeSupported(newValue) {
-                            device.torchMode = newValue
-                        }
-                        device.unlockForConfiguration()
-                    } catch {
-                        print("NextLevel, torchMode failed to lock device for configuration")
-                    }
+                guard let device = self._currentDevice,
+                    device.hasTorch,
+                    device.torchMode != newValue
+                else {
+                    return
+                }
+                
+                do {
+                    try device.lockForConfiguration()
+                    if device.isTorchModeSupported(newValue) {
+                        device.torchMode = newValue
+                    }
+                    device.unlockForConfiguration()
+                } catch {
+                    print("NextLevel, torchMode failed to lock device for configuration")
                 }
             }
         }

    /// Checks if focus adjustment is in progress.
    public var isAdjustingFocus: Bool {
        get {
            if let device: AVCaptureDevice = self._currentDevice {
                return device.isAdjustingFocus
            }
            return false

    
    // re-entrant configuration lock, thanks to SCRecorder
    internal func beginConfiguration() {
        guard let session = self._captureSession else {
            return
        }

        self._sessionConfigurationCount += 1
        if self._sessionConfigurationCount == 1 {
            session.beginConfiguration()
        }
    }
    
    internal func commitConfiguration() {
        guard let session = self._captureSession else {
            return
        }
        
        self._sessionConfigurationCount -= 1
        if self._sessionConfigurationCount == 0 {
            session.commitConfiguration()
        }
    }
    
    internal func configureSessionDevices() {
        guard let _ = self._captureSession else {
            return
        }
        
