         dbFile["fileName"] = remoteFile["name"]
         dbFile["mimeType"] = remoteFile["mimeType"]
         dbFile["fileSize"] = remoteFile["size"]
+        dbFile["isDeletedFromDrive"] = false
+        return dbFile
+    }
+    
+    class func mergeFiles(dbFile: inout [String: Any], remoteFile:[String: Any], folder : YSFolder) -> [String: Any]
+    {
+        var dbFile = dbFile
+        dbFile["fileDriveIdentifier"] = remoteFile["fileDriveIdentifier"]
+        dbFile["folder"] = toDictionary(type: folder)
+        dbFile["fileName"] = remoteFile["fileName"]
+        dbFile["mimeType"] = remoteFile["mimeType"]
+        dbFile["fileSize"] = remoteFile["fileSize"]
         dbFile["isDeletedFromDrive"] = false
         return dbFile
     }

                    //map ysfiledict to remote property names
                    let fileIdentifier = remoteFile["id"] as! String
                    var emptyFile = [String : Any]()
                    let mergedFile = mergeYSFiles(dbFile: &emptyFile, remoteFile: remoteFile, folder: folder)
                    remoteFilesDict[fileIdentifier] = mergedFile
                }
                for var dbFile in dbFilesArrayDict

                    isRootFolderAdded = currentFileIdentifier == rootFolderID
                    if let remoteFile = remoteFilesDict[currentFileIdentifier]
                    {
                        dbFile.value = mergeFiles(dbFile: &dbFile.value, remoteFile: remoteFile, folder: folder)
                    }
                    else
                    {
