only write files when content was changed