             td.id = i
           td
 
-        generateMultiple = (cat, cols, row, i, n, t, m) ->
+        generateMultiple = (col, cols, row, i, n, t) ->
           if n == undefined
             return if t == 1
           else
             return if n < t
           td = row.appendChild(document.createElement('td'))
           td.setAttribute("colspan", cols)
+          cat = col.category
           if n == undefined && t > 1
             td.appendChild(document.createTextNode(t + " " + cat.name + "s"))
             td.className = 'more'


        generateAsset = (row, i, n) ->
          a = assets[i]
          return if generateMultiple(pseudoCategory.asset, 3, row, i, n, a.length)
          b = i
          if n == undefined
            a = a[0]

              else if editing
                td.appendChild(document.createTextNode("add " + cat.name))
              if editing
                if 'metrics' of col && col.metrics[0].id != 'id'
                  generateCell(row, undefined, undefined, id+'-rec_'+i+'_'+(n||0)+'_'+col.start)
                  if cols > 1
                    row.appendChild(td)
                    td.setAttribute("colspan", cols-1)
                  else
                    row.removeChild(td)
                td.className = 'null add'
                td.id = id + '-add_' + i + '_' + cat.id
          td
