detecting circular dependencies