Avoid logout loops