write_data to txt