fixed login/logout refresh bug