added support for circular dependencies

added support for circular dependencies