Fix to crash when logged out