Fix undefined session index