fixed crash on logout