Added circular dependency check