prevent runaway recursion when detecting dependencies