added check for circular dependencies
Merge pull request #2 from badunk/circular

added check for circular dependencies