             if !searchText.isEmpty {
                 isFilterEnabled = true
             }
+            else {
+                isFilterEnabled = false
+            }
+        } else {
+            isFilterEnabled = false
         }
         
         let city = cityManager.cityAtIndex(index: indexPath.row, isFilterEnabled: isFilterEnabled)
+        
         cell.textLabel?.text = "\(city.name), \(city.country)"
         return cell
     }

        if let searchText = searchController.searchBar.text {
            if !searchText.isEmpty {
                cityManager.filterCityList(searchText: searchText)
                tableView.reloadData()
            }
            
        }
        

        if let searchText = searchController.searchBar.text {
            if !searchText.isEmpty {
                isFilterEnabled = true
            } else {
                isFilterEnabled = false
            }
        }else {
            isFilterEnabled = false
        }
        return cityManager.getCitiesCount(isFilterEnabled: isFilterEnabled)
    }
