 // MARK: UICollectionViewDelegate
 extension MasterViewController: UICollectionViewDelegate {
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        showCounty(countiesToDisplay[collectionView.indexPathsForSelectedItems!.first!.item], animated: true)
+        showCounty(dataSource.itemIdentifier(for: indexPath)!, animated: true)
         collectionView.deselectItem(at: indexPath, animated: false)
     }
 }

        }
    }
}

    
    private func updateSearchResults(forSearchText searchText: String?) {
        spotlightSearchController.search(withQueryString: searchText ?? "") { [unowned self] in
            self.dataSource.apply(self.snapshotForCurrentState(), animatingDifferences: false)
        }
    }
}
