only update model attributes when necessary