     /// Same semantics as `Index.browse()`.
     ///
     @objc public func browseMirror(query: Query, completionHandler: CompletionHandler) -> NSOperation {
+        let queryCopy = Query(copy: query)
         let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
-        let queryCopy = Query(copy: query)
-        let operation = NSBlockOperation() {
-            self._browseMirror(queryCopy) {
-                (content, error) -> Void in
-                callingQueue.addOperationWithBlock() {
+        let operation = NSBlockOperation()
+        operation.addExecutionBlock() {
+            let (content, error) = self._browseMirror(queryCopy)
+            callingQueue.addOperationWithBlock() {
+                if !operation.cancelled {
                     completionHandler(content: content, error: error)
                 }
             }

    }
    
    /// Search the local mirror.
    @objc public func searchMirror(query: Query, completionHandler: CompletionHandler) {
        let callingQueue = NSOperationQueue.currentQueue() ?? NSOperationQueue.mainQueue()
        self.offlineClient.searchQueue.addOperationWithBlock() {
            self._searchMirror(query) {
                (content, error) -> Void in
                callingQueue.addOperationWithBlock() {
                    completionHandler(content: content, error: error)
                }
            }
        }
    }
    
    /// Search the local mirror synchronously.
    private func _searchMirror(query: Query, completionHandler: CompletionHandler) {
        assert(!NSThread.isMainThread()) // make sure it's run in the background
        assert(self.mirrored, "Mirroring not activated on this index")
        

            error = NSError(domain: Client.ErrorDomain, code: Int(searchResults.statusCode), userInfo: nil)
        }
        assert(content != nil || error != nil)
        return (content: content, error: error)
    }
}
