added error checking to sign in