Fixed bug in session manager