fixed bug where an incorrect login would not cause the program to exit