Fixed the code so you can't log in with an incorrectly registered user.