     file = node.data 'file'
     file.labels.push label for label in labels
     @api.save FILES, file, (result) ->
-    this.labelNode node, label for label in labels
-    this.findLabels()
+    for label in labels
+      this.labelNode node, label
+      this.updateLabelCount label, 1
     false
 
   removeLabel: (node, item) ->

    file.labels = (label for label in file.labels when label != remove)
    @api.save FILES, file, (result) ->
    item.fadeOut 200, -> item.remove()
    this.findLabels()

  deleteFile: (node) ->
    @api.remove FILES, node.attr('data-id'), (result) =>
      node.fadeOut 200, -> node.remove()
    false


    $('.text', node).text label.name
    node.attr 'data-name', label.name
    node.click (event) => this.selectLabel(event)

  selectLabel: (event) ->
    name = $(event.currentTarget).attr 'data-name'
