Fixed a bug when the user logged out