 
     open func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
         searchBar.resignFirstResponder()
-        guard let query = preparedSearchQuery, !query.isEmpty else { return }
+        guard hasSearch else { return }
         shouldDebounceNextSearch = false
-        searchQuery = query
+        searchQuery = preparedSearchQuery
     }
 
     open func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {


    // MARK: Implementation

    fileprivate var removableAnnotations: [MKAnnotation] {
        return mapView.annotations.filter(isNonSelectedPlacemark)
    }


extension MapViewController: UISearchResultsUpdating {

    open func updateSearchResults(for searchController: UISearchController) {
        guard hasSearch else {
            mapView.removeAnnotations(removableAnnotations)
            return
        }
        searchQuery = preparedSearchQuery
    }

}
