Set modify state only if there are changes.