Fixed issue where login, close, login, close wouldn't close