Fix duplicate search results bug