Correct logout logic