Fixed stack initialization after change to scopedRef