Fix issue where write event was not unregistered correctly