             guard
                 let data = characteristic.value,
                 let dict = NSKeyedUnarchiver.unarchiveObject(with: data) as? [String: Any],
-                var peer = self.getSavedPeer(withId: peripheral.identifier)
+                var peer = peerManager.getSavedPeer(withId: peripheral.identifier.uuidString)
             else {
                 return
             }


extension Clink: ClinkPeerManager {
    public func save(peer: ClinkPeer) {
        UserDefaults.standard.set(peer.toDict(), forKey: peer.id.uuidString)
        
        var savedPeerIds = UserDefaults.standard.stringArray(forKey: savedPeerIdsDefaultsKey) ?? []
        
        if savedPeerIds.index(of: peer.id.uuidString) == nil {
            savedPeerIds.append(peer.id.uuidString)
            UserDefaults.standard.set(savedPeerIds, forKey: savedPeerIdsDefaultsKey)
        }
    }
    
    public func getSavedPeer(withId peerId: UUID) -> ClinkPeer? {
        guard let peerDict = UserDefaults.standard.dictionary(forKey: peerId.uuidString) else { return nil }
        
        return Clink.Peer(dict: peerDict)
    }
    
    public func getSavedPeers() -> [ClinkPeer] {
        return (UserDefaults.standard.stringArray(forKey: savedPeerIdsDefaultsKey) ?? []).flatMap { uuidString in
            guard let uuid = UUID(uuidString: uuidString) else { return nil }
            
            return self.getSavedPeer(withId: uuid)
        }
    }
    
    public func delete(peer: ClinkPeer) {
        UserDefaults.standard.removeObject(forKey: peer.id.uuidString)
    }
}



        var connectedPeers: [ClinkPeer] = []
        
        for peripheral in activePeripherals where peripheral.state == .connected {
            if let peer = peerManager?.getSavedPeer(withId: peripheral.identifier.uuidString) {
                connectedPeers.append(peer)
            }
        }
