Logout bug fix