fix loggin failed bug