             }
             
             // store in cache
-            cache.insert(foundCharacteristics, for: gattService)
+            cache.insert(foundCharacteristics, for: service.identifier)
             
             return cache.service(for: service.identifier)?.characteristics.map {
                 Characteristic(identifier: $0.key,

        }
        
        mutating func insert(_ newValues: [GATTClient.Characteristic],
                             for service: GATTClient.Service) {
            
            // remove old values
            services[UInt(service.handle)]?.characteristics.removeAll(keepingCapacity: true)
            
            // insert new values
            newValues.forEach {
                services[UInt(service.handle)]?.characteristics[UInt($0.handle.declaration)] = CharacteristicCache(attribute: $0, notification: nil, descriptors: [:])
            }
        }
    }
    

                
            } else {
                
                // fetch descriptors
                let _ = try discoverDescriptors(for: characteristic, timeout: timeout)
                
                // get updated cache
                if let cache = self.cache.characteristic(for: characteristic.identifier)?.1.descriptors.values.map({ $0.attribute }) {
                    
                    descriptors = Array(cache)
                    
                } else {
                    
                    descriptors = []
                }
            }
            
            // GATT request
            try async(timeout: timeout) {
                client.registerNotification(notification,
                                            for: gattCharacteristic.attribute,
                                            descriptors: descriptors,
                                            completion: $0)
            }
        }
