logout bug fixes