relogin bug fix, and some bug fix