error handling in registration form