 
       # Tell the projection that it will be rebuilt now
       projection.enterRebuildMode()
-      projectionsToRebuild.push projection
+      queue.push projection
 
     # Loop through all events and hand them individually to all projections
     for event in @commitStore.getAllEvents()
-      projection.on(event, true) for projection in projectionsToRebuild
+      projection.on(event, true) for projection in queue
 
     # Update the real collection data with the in-memory versions
     # for the specified projections only.

      if inMemoryData.length
        realCollection.batchInsert inMemoryData
      else
        throw new Error "No data to insert after replaying projection for #{collectionId}"
      # Restore original collections
      @injector.override(collectionId).to realCollection

    for projection in projectionsToRebuild
      projection.exitRebuildMode()

  _getCollectionIdsOfProjection: (projection) ->

      throw new Error 'You have to provide an array of projection qualifiers.'

    realCollectionsBackups = {}
    queue = []

    # Loop over all projections that should be rebuilt
    for projectionId in options.projections
