add validation to update method