Added checks for circular dependencies and modified teh validate method
to consider incoming dependencies