only write to file if something has changed