         if self.passiveMode {
             self.ftpPassive(task, completionHandler: completionHandler)
         } else {
-            self.ftpActive(task, completionHandler: completionHandler)
+            dispatch_queue.async {
+                self.ftpActive(task, completionHandler: completionHandler)
+            }
         }
     }
     

            }
            
            // Successful
            if response?.hasPrefix("35") ?? false {
                completionHandler(nil)
            } else {
                let spaceIndex = response?.characters.index(of: "-") ?? response?.startIndex
                let code = Int((response?.substring(to: spaceIndex!).trimmingCharacters(in: .whitespacesAndNewlines))!) ?? -1
                let description = response?.substring(from: spaceIndex!).trimmingCharacters(in: .whitespacesAndNewlines)
                let error = FileProviderFTPError(code: code, path: "", errorDescription: description)
                completionHandler(error)
                return
            }

                }
                
                if !success && !(response.hasPrefix("25") || response.hasPrefix("15")) {
                    let error = FileProviderFTPError(message: response, path: path)
                    self.dispatch_queue.async {
                        completionHandler([], error)
                    }
