Change the order of opening a window and closing the login so that it
stays open