check for circular dependency