Fix bug in log out