       handle = Tracker.autorun (computation) ->
         result = runFunc.call publish, computation
 
-        unless checkNames publish, collectionNames, computation, result
+        collectionNames = getCollectionNames result
+        allCollectionNames[computation._id] = collectionNames
+
+        computation.onInvalidate ->
+          delete allCollectionNames[computation._id]
+
+        unless checkNames publish, allCollectionNames, "#{computation._id}", collectionNames
           computation.stop()
           return
 


    result = publishFunction.apply publish, args

    return unless checkNames publish, collectionNames, null, result

    # Specially handle if computation has been returned.
    if result instanceof Tracker.Computation

Fiber = Npm.require 'fibers'

getCollectionNames = (result) ->
  if result and _.isArray result
    resultNames = (cursor._getCollectionName() for cursor in result when _.isObject(cursor) and '_getCollectionName' of cursor)
  else if result and _.isObject(result) and '_getCollectionName' of result
