avoid infinite loop in ToUrl()