     public final func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
         if self.logLevel == .verbose { print("calling \(#function)") }
         
-        if newlyDiscoveredPeripheral?.identifier != peripheral.identifier {
+        if activePairingTask?.remotePeripheral?.identifier != peripheral.identifier {
             if let i = self.connectedPeers.index(where: { $0.id == peripheral.identifier }) { self.connectedPeers.remove(at: i) }
             
             let peer = ClinkPeer(id: peripheral.identifier)

    }
}

// MARK: - CENTRAL MANAGER DELEGATE METHODS

extension Clink: CBPeripheralDelegate {

            
            NotificationCenter.default.post(name: Clink.Notifications.didDiscoverPeer, object: peer, userInfo: peer.data)
            
            if self.activePairingTask != nil {
                self.centralManager.stopScan()
                self.activePairingTask?.timer.invalidate()
                self.activePairingTask?.completion(OpperationResult.success(result: peer))
                self.activePairingTask = nil
            }
            
            
