form validation and user registration