write the file