helper function for collecting urls from ref tags that have names