     private func loadLocations() {
         let locationsURL = "\(self.url)locations/"
 
-        func onResponse(headers: HTTPHeaders, json: AnyObject?) {
+        func removeConnection() {
             removeConnectionForLoadingGroup(
                 group: IMSLoadingGroup.Locations,
                 id: IMSConnectionID.Locations
             )
-
+        }
+        
+        func onResponse(headers: HTTPHeaders, json: AnyObject?) {
+            defer { removeConnection() }
+            
             guard let json = json else {
                 logError("Locations request retrieved no JSON data")
                 return

        }

        func onError(message: String) {
            logError("Error while attempting incident #\(number) request: \(message)")
            // resetConnection()
        }

        logHTTP("Sending incident #\(number) request to: \(incidentURL)")

                loadIncident(number: number, etag: etag)
            }

            logHTTP("Loaded incident list")
        }

        func onError(message: String) {
            defer { removeConnection() }

            logError("Error while attempting incident list request: \(message)")
        }

        logHTTP("Sending incident list request to: \(incidentsURL)")
