         }
         
         // validate application errors with write callback
-        if let error = willWrite?(attribute.uuid, handle, attribute.value, value) {
+        if let error = await willWrite?(attribute.uuid, handle, attribute.value, value) {
             await doResponse(await errorResponse(opcode, error, handle))
             return
         }

            for (handle, newValue) in newValues {
                let attribute = database[handle: handle]
                // validate application errors with write callback
                if let error = willWrite?(attribute.uuid, handle, attribute.value, newValue) {
                    await errorResponse(opcode, error, handle)
                    return
                }

        maximumTransmissionUnit: ATTMaximumTransmissionUnit = .default,
        maximumPreparedWrites: Int = 50,
        log: ((String) -> ())? = nil,
        willRead: ((_ uuid: BluetoothUUID, _ handle: UInt16, _ value: Data, _ offset: Int) async -> ATTError?)? = nil,
        willWrite: ((_ uuid: BluetoothUUID, _ handle: UInt16, _ value: Data, _ newValue: Data) async -> ATTError?)? = nil,
        didWrite: ((_ uuid: BluetoothUUID, _ handle: UInt16, _ value: Data) async -> Void)? = nil
    ) async {
        // set initial MTU and register handlers
        self.maximumPreparedWrites = maximumPreparedWrites
