fixed logout bug #1