Fixed crash on logout