fixed small bug so that if you close login window the program exits