added validation to update