fix bug with repeated search results - use SortedSet