   _commit: (callback) ->
     return callback null if Object.keys(@aggregateEvents).length is 0
 
-    events      = [];
     savedEvents = [];
 
     aggregateQueue = async.queue (aggregateAppliedEvents, aggregateTaskCallback) =>


    aggregateQueue.drain = (err) =>
      return callback err if err?
      return callback null unless events.length > 0
      publicationQueue = async.queue (event, publicationCallback) =>
        @_publishEvent event, publicationCallback
      , Infinity
      publicationQueue.drain = callback
      publicationQueue.push events

    for aggregateUid, aggregateEvents of @aggregateEvents
      aggregateQueue.push [aggregateEvents]

          queue.push nextEvent if nextEvent?

          @logger.log "commit", "saving event \"#{event.name}\" for aggregate #{event.aggregateUid}"
          @store.saveEvent event, (err, event) =>
            savedEvents.push(event);
            if err?
