sessions memory leak fix