made session access thread safe