Fixed initalizeSession method