 
 feedbin.applyCounts = (useHideQueue) ->
   $('[data-behavior~=needs_count]').each (index, countContainer) =>
-    group = $(countContainer).data('count-group')
-    groupId = $(countContainer).data('count-group-id')
-    collection = $(countContainer).data('count-collection')
-    countHide = $(countContainer).data('count-hide') == 'on'
+    countContainer = $(countContainer)
+    group = countContainer.data('count-group')
+    groupId = countContainer.data('count-group-id')
+    collection = countContainer.data('count-collection')
+    countHide = countContainer.data('count-hide') == 'on'
 
     if !collection
       collection = 'unread'

        count = counts[groupId].length
    else
      count = counts.length
    $(countContainer).text(count)

    if count == 0
      $(countContainer).addClass('hide')
    else
      $(countContainer).removeClass('hide')

    if groupId || countHide
      container = $(countContainer).parents('li').first()
      feedId = $(container).data('feed-id')
      if useHideQueue
        if count == 0 && countWas > 0

    feedbin.specialCollection = $(event.currentTarget).data('special-collection')

    # Drain hide queue if this isn't the same collection
    if feedbin.selectedFeed
      isParent = $(event.currentTarget).parent('li[data-tag-id]').parent(feedbin.selectedFeed).length != 0
      isSelf = feedbin.selectedFeed.is(event.currentTarget)
      if !isParent && !isSelf
        $.each feedbin.hideQueue, (index, feed_id) ->
          if feed_id != undefined
            item = $(".feeds li[data-feed-id=#{feed_id}]")
            count = $('[data-behavior~=needs_count]', item).text() * 1
            if count == 0
              $(item).addClass('zero-count')
        feedbin.hideQueue.length = 0

    feedbin.selectedFeed = $(event.currentTarget)
    return
