Add safeguard against infinite routing loops