            [:a {:style {:cursor "pointer" :text-align "center"} :data-dismiss "modal" :on-click #(do
                                                                                                    (swap! state assoc :show-issuer-info false
                                                                                                           :issuer-content {:name (t :core/All) #_(t :badge/Issuers)})
-                                                                                                   (issuer-badges "" state))} (t :core/All)]]
+                                                                                                   (issuer-applications "" state))} (t :core/All)]]
           (doall
             (for [app (sort-by :issuer_content_name (distinct-by :issuer_content_name @applications))
                   :let [{:keys [issuer_content_name issuer_image issuer_content_url issuer_content_id]} app
-                        badges-count #_(issuer-badges-behind-scenes issuer_content_name state) (issuer-badge-count issuer_content_name state)
+                        badges-count (issuer-applications-count issuer_content_name state)
                         ;testing
                         banner (if (even? (count issuer_content_name)) true false)]]
               [:a { :key issuer_content_id

          :control-class   "form-control"}]]])))


(defn issuer-badges [issuer-name state]
  (swap! state assoc :issuer-name issuer-name)
  (fetch-badge-adverts state))


;TODO FIX to run on the background and calculate badge count for each issuer
(defn issuer-badge-count [issuer-name state]
  (count (filter #(= issuer-name (:issuer_content_name %)) (:applications @state))))

(defn- issuer-image [path]
  (when (not-empty path)

                                 (.preventDefault %)
                                 (swap! state assoc :show-issuer-info true
                                        :issuer-content {:id issuer_content_id :name issuer_content_name :image issuer_image :url issuer_content_url :banner banner})
                                 (issuer-applications issuer_content_name state)

                                 )}
               [:div {:style {:padding "5px"}} (if issuer_image
