Added validation for user registration