                 }
             })
             
-            dataTask.resume()
+            dataTask?.resume()
         }
     }
     

        if !searchBar.text!.isEmpty {
            searchBar.resignFirstResponder()
        
            isLoading = true
            tableView.reloadData()
        

        
            let url = urlWithSearchText(searchBar.text!)
            let session = NSURLSession.sharedSession()
            dataTask = session.dataTaskWithURL(url, completionHandler: {
                (data, response, error)  in
                if let error = error where error.code == -999 {
                    return // Search was cancelled
                } else if let httpResponse = response as? NSHTTPURLResponse where httpResponse.statusCode == 200 {
                    if let data = data, dictionary = self.parseJSON(data) {
                        self.searchResults = self.parseDictionary(dictionary)
