fixing bug in session