Adding error handling to the registration form.