only mark a field as changed if the value has changed

Prevents spurious changes from being recorded.