Fix cyclic dependency error in session instantiation