fixed bug when logging out