   # @return {DropshipList} this
   updateFileState: (file, callback) ->
     @db (db) =>
-      @files (files) =>
+      @getFiles (files) =>
         transaction = db.transaction 'metadata', 'readwrite'
         metadataStore = transaction.objectStore 'metadata'
         request = metadataStore.put file.json()

  # @return {DropshopList} this
  removeDb: (callback) ->
    @db (db) =>
      @files (files) =>
        db.close() if db
        request = indexedDB.deleteDatabase @dbName
        request.oncomplete = =>

  # @return {DropshipList} this
  addFile: (file, callback) ->
    @db (db) =>
      @getFiles (files) =>
        transaction = db.transaction 'metadata', 'readwrite'
        metadataStore = transaction.objectStore 'metadata'
        request = metadataStore.put file.json()
