logout bug fix