             } else {
                 enabledLabel.textColor = UIColor.lightGray
                 enabledSwitch.isEnabled = false
-                enabledSwitch.isOn = false
             }
         } else {
             statusLabel.text = "Disconnected"

                break
            case PeripheralError.disconnected:
                self.peripheral?.reconnect()
            default:
                self.present(UIAlertController.alertOnError(error), animated:true, completion:nil)
            }
            self.peripheral = nil
            self.updateUIStatus()
        }


            case AppError.updateCharactertisticNotFound:
                fallthrough
            case AppError.serviceNotFound:
                self.peripheral?.disconnect()
                self.present(UIAlertController.alertOnError(error), animated:true, completion:nil)
            case AppError.invalidState:
                self.present(UIAlertController.alertWithMessage("Invalid state"), animated: true, completion: nil)
