fixed issue where exception thrown when logging in with incorrect username or password