added sub write_file