Make SessionState thread-safe
Clean up