Fixing up callback for writes