added form validation to register-login