Prevent infinite loops when there are circular dependencies