fix crashing after login