added validation to the user model