diff --git a/src/gatt-database.c b/src/gatt-database.c
index 11d886c..483c843 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
{
struct pending_op *op;
- op = pending_write_new(device, NULL, attrib, id, value, len, 0,
- link_type, false, false);
+ op = pending_write_new(device, chrc->pending_writes, attrib, id, value,
+ len, 0, link_type, false, false);
if (g_dbus_proxy_method_call(chrc->proxy, "AcquireWrite",
acquire_write_setup,
if (g_dbus_proxy_get_property(chrc->proxy, "NotifyAcquired", &iter)) {
op->data.iov_base = (void *) chrc;
op->data.iov_len = sizeof(chrc);
+ op->owner_queue = chrc->pending_writes;
if (g_dbus_proxy_method_call(chrc->proxy, "AcquireNotify",
acquire_notify_setup,
acquire_notify_reply,