Fixing logout bug