             openPanel.allowedFileTypes=["json"]
         }
         openPanel.beginWithCompletionHandler({ (result) in
-            if result==NSFileHandlingPanelOKButton{
-                if let url = openPanel.URL {
-                    if let filePath=url.path {
-                        self.importMetadataFrom(filePath,crypted: crypted,handlers:handlers)
+            dispatch_async(dispatch_get_main_queue(), {
+                if result==NSFileHandlingPanelOKButton{
+                    if let url = openPanel.URL {
+                        if let filePath=url.path {
+                            self.importMetadataFrom(filePath,crypted: crypted,handlers:handlers)
+                        }
                     }
                 }
-            }
-
+            })
         })
     }
 
-    
+
     #endif
 
     /**

                    }
                }
            }

            }) { (context) in

                handlers.on(Completion.failureStateFromJHTTPResponse(context))
        }

    }


}

            savePanel.allowedFileTypes=["json"]
        }
        savePanel.beginWithCompletionHandler({ (result) in
            dispatch_async(dispatch_get_main_queue(), {
                if result==NSFileHandlingPanelOKButton{
                    if let url = savePanel.URL {
                        if let filePath=url.path {
                            self.exportMetadataTo(filePath,crypted: crypted, handlers:handlers)
                        }
                    }
                }
            })
        })
    }

