Fixed logout loop error