fixed recursion in ref2resource