Fixed issues on relogin