Fixed bug when logging out.