   # success.
   @create = (docName, docData, callback) ->
     async.auto(
-      write_metadata: (callback) ->
+      write_metadata: (cb) ->
 
         request =
           TableName: snapshots_table,

  # deleted and the error message if something went wrong.
  @delete = (docName, dbMeta, callback) ->
    async.auto(
      list_snapshots: (callback) ->
        request =
          TableName: snapshots_table
          HashKeyValue: { S: docName }

        db.query(request, cb)

      get_data: ['get_snapshot', (cb, results) ->
        return cb('Document does not exist', null) unless results.get_snapshot.Count == 1

        item = results.get_snapshot.Items[0]
        s3.get('/'+snapshots_bucket+'/'+item.doc.S+'-'+item.v.N+'.snapshot', 'buffer', cb)
