implementation for common_callback_write