fix the overwriting error with logout #1 cc @hazourano