updated the session initialization code