         
         let peer = Peer(peripheral: peripheral)
         
-        if let i = self.connectedPeers.index(where: { $0.id == peripheral.identifier }) {
-            self.connectedPeers[i] = peer
+        if let i = self.activePeripherals.index(where: { $0.identifier == peripheral.identifier }) {
+            self.activePeripherals[i] = peripheral
         } else {
-            self.connectedPeers.append(peer)
+            self.activePeripherals.append(peripheral)
         }
         
         self.centralManager.connect(peripheral, options: nil)

    fileprivate func connect(peerWithId peerId: UUID) {
        Clink.Configuration.dispatchQueue.async {
            if
                let i = self.connectedPeers.index(where: { $0.id == peerId }),
                let peripheral = self.connectedPeers[i].peripheral,
                peripheral.state == .connected
            {
                return
            }

    
    public func addNotificationHandler(_ handler: @escaping Clink.NotificationHandler) -> Clink.NotificationRegistrationToken {
        let token = NotificationRegistrationToken()
        let peerManager = Clink.Configuration.peerManager
        
        var connectedPeers: [ClinkPeer] = []
        
        for peripheral in activePeripherals where peripheral.state == .connected {
            if let peer = peerManager?.getSavedPeer(withId: peripheral.identifier) {
                connectedPeers.append(peer)
            }
        }
        
        notificationHandlers[token] = handler
        
