write status to file