cyclic dependency checking