         let group = DispatchGroup()
         queue.async {
             var result = [FileObject]()
-            var success = true
+            var errorInfo:Error?
             group.enter()
             self.contentsOfDirectory(path: path, completionHandler: { (files, error) in
-                success = success && (error == nil)
                 if let error = error {
+                    errorInfo = error
                     group.leave()
-                    completionHandler([], error)
                     return
                 }
                 

                    group.enter()
                    _=self.recursiveList(path: dir.path, useMLST: useMLST, foundItemsHandler: foundItemsHandler) {
                        (contents, error) in
                        success = success && (error == nil)
                        if let error = error {
                            completionHandler([], error)
                            group.leave()
                            return
                        }

            })
            group.wait()
            
            if let error = errorInfo {
                completionHandler([], error)
            } else {
                self.dispatch_queue.async {
                    completionHandler(result, nil)
                }
