fixed the proper removal of login dialog; fixed routing issue of login