fix bug when login failed