rid some bugs in log out