fixed a bug with log out