added validation to user model