fix issue in recursive dependency stacking