     # show up
     .then (map) =>
       @showPackageList map
-    .catch (err) ->
+    .catch (err) =>
       console.log err.message
       console.trace err.stack
 

    # .then (result) =>
  upload: (cell, module)->
    cell.changeState 'upload'

    @login 'cube', 'cube', 'cube'
    .then (result) =>
      throw new Error('login fail') unless result.result is 'true'
      console.log "upload"
      zip = new AdmZip()
      # zip.addLocalFolder path.join(atom.project.path, 'encrypt', module.package.identifier)
      zip.addLocalFolder module.path
      @uploadAttach zip.toBuffer()
    .then (result) =>
      console.log "validate"
      throw new Error('upload fail') unless result.result is 'success'

    @div class: 'overlay from-top select-list', =>
      @ol outlet: 'list', class: 'list-group package-list'
      @button 'Cancel', click: 'destroy', class: "btn btn-lg"
      @span class: "loading loading-spinner-small inline-block pull-right",outlet: 'loading'

  attach: ->
    request = request.defaults({jar: true})

    root = atom.project.path

    @loading.hide();

    readdir(root)
    # filter butterfly packages
