only write part when content is changed