logout loop fixed