fix cyclic dependency detection