     }
     
     public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
+        UserDefaults.standard.set(peripheral.identifier.uuidString, forKey: lastConnectedUrband)
+        UserDefaults.standard.synchronize()
         peripheral.delegate = self
+        connectedUrband = peripheral
         
         if let _ = peripheral.services {
-            UserDefaults.standard.set(peripheral.identifier.uuidString, forKey: lastConnectedUrband)
-            
-            connectedUrband = peripheral
             urbandDelegate?.urbandReady(peripheral)
         }
         else {

    }
    
    public func connect(_ urband: CBPeripheral) {
        UserDefaults.standard.set(urband.identifier.uuidString, forKey: lastConnectedUrband)
        UserDefaults.standard.synchronize()
        
        centralManager.connect(urband, options: nil)
    }
    

    }
    
    public func activateGestures(_ urband: CBPeripheral) {
        if let cfa01 = urband.services?[1].characteristics?[0] {
            urband.writeValue(Data(bytes: [0x00]), for: cfa01, type: .withResponse)
        }
        else {
            debugPrint("There are not discover characteristics in urband \(urband.identifier.uuidString)")
        }
    }
    
    public func deactivateGestures(_ urband: CBPeripheral) {
