Fixed the session manager (testing needs to be done)