added graph-inheritence check