use smart pointers in DagNode