implementation of validation for user registration