fix logoff bug