         if view
           view.remove()
           delete @views[model.cid]
+
+    @cachedCount = count
     @showAlerts()
-    @cachedCount = count
+
     return count
 
   count: () ->

      # console.log("[alert off] #{selector}")
      @listMeta.set(selector, false)
      @$el.find(selector).addClass @emptyToggleClass

module.exports =
  mixins:

    @listEl.empty()
    @views = {}
    if @collection.length > 0
      @addGroup(@collection.models)

  addGroup: (group) ->
    if group.length > 0
      console.log("---- grouping ----")

      container = document.createDocumentFragment()
      group.forEach (instance) =>
        this.added(instance, container)

      this.getListElement().append(container)

  remove: () ->
    for cid, view of @views
