write to the file