only save if something has changed