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

            if !searchText.isEmpty {
                isFilterEnabled = true
            }
        }
        
        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)
            }
            
            // Reload TableView everytime there is update in Searchbar to get updates when there is text in searchbar, but also get update when text is cleared.
            
            tableView.reloadData()
            
        }
        
