write to file.