make write_data usable