fixed infinite login - logout loop