             if let data = data {
                 update(data: data, forRecord:recordId, fileLink:fileLink)
             } else {
-                removeRecordsForRecordId(recordId as AnyObject, fileLink:fileLink)
+                removeRecordsForRecordId(recordId, fileLink:fileLink)
             }
             return
         }

    }

    //todo rename?
    private func removeRecordsForRecordId(_ recordId: AnyObject, fileLink: String) {

        fileLink.cacheDBFileLinkRemoveFileWithFolder(self.db.folder)



        if let fileLink = fileLinkForRecordId(recordId) {

            removeRecordsForRecordId(recordId, fileLink:fileLink)
        }
    }

