add checking on multiple rooted DAG