Added validation to user model