fix login crashing when session state is closed