         errored: true
         status: "Invalid PDF file"
 
-# process next element from preprocess queue
+# Process next element from preprocessing queue
 Deps.autorun ->
-  # we exclude status field so that it doesn't get recalled on status change
   document = ImportingFile.documents.findOne
     sha256:
       $exists: false
-    buffered: true
   ,
     fields:
-      status: 0
+      _id: 1
   return unless document
 
   ImportingFile.documents.update document._id,
     $set:
       status: "Preprocessing"
 
-  console.log "Called autorun for preprocessing queue " + document.name
-
   reader = new FileReader()
   reader.onload = ->
-    importingFilesArrayBuffer[document._id].content = @result
-    console.log "Testing PDF with PDFJS"
-    testPDF importingFilesArrayBuffer[document._id], ->
-      console.log "Computing checksum"
-      computeChecksum importingFilesArrayBuffer[document._id], (error, result) ->
+    importingFiles[document._id].content = @result
+    testPDF importingFiles[document._id], ->
+      computeChecksum importingFiles[document._id], (error, result) ->
         if error
           ImportingFile.documents.update document._id,
             $set:

# Local (client-only) document of importing files
class ImportingFile extends Document
  # name: user's file name
  # readProgress: progress of reading from file, in %
  # uploadProgress: progress of uploading file, in %
  # status: current status or error message
  # finished: true when importing has finished

          imported: true
          publicationId: publicationId

# Process next element from import queue
Deps.autorun ->
  document = ImportingFile.documents.findOne
    finished: false
    errored: false
