           log "writing media file: #{file.name}, #{file.type}"
           @wordpress.uploadFile file, (error, result) ->
             if error
-              console.error red error, "\nfilename: ", result.file
+              console.error red error, "\nfilename: ", file.name
               reject error
             else
               result.origUrl = origUrl


    @authors = {}

    @categories =
      "5xf4F6wNdCvn99kqj": '1' # "News"
      "zEG4a7tHmychqAqH7": '2' # "Inspiration"
      "kFyCNMFZ4gyf4sM9T": '3' # "Health & Wellness"
      "uwj6gP5w3tcDCHRE4": '4' # "Flower of Life"
      "8tpkEKhLLPoiWdFLz": '5' # "Universe Explorers"

    @whenReady = @_getMediaLibrary()
      .then (media) => @media = media

          resolve
            origUrl: origUrl
            url: @media[md5sum].link
            id: @media[md5sum].attachment_id
        else
          file =
            name: filename
