add error handling for registration form