                         peripheral: peripheralObject
                     )
                     continuation.yield(characteristic)
-                    continuation.finish(throwing: nil)
-                }
+                }
+                continuation.finish(throwing: nil)
             }
             // remove callback
             self.central.continuation.discoverCharacteristics[peripheral] = nil

            didWriteValueFor characteristicObject: CBCharacteristic,
            error: Swift.Error?
        ) {
            if let error = error {
                self.central.log("Error writing characteristic (\(error))")
            } else {
                self.central.log("Peripheral \(peripheralObject.gattIdentifier.uuidString) did write value for characteristic \(characteristicObject.uuid.uuidString)")
            }
            let characteristic = Characteristic(
                characteristic: characteristicObject,
                peripheral: peripheralObject

            error: Swift.Error?
        ) {
                        
            log(corePeripheral.gattIdentifier.uuidString, error?.localizedDescription)
            
            let peripheral = Peripheral(corePeripheral)
            self.central.continuation.didDisconnect.yield(peripheral)
