   emitConsumeTask: (message, queue, ironTask) ->
     try
       taskArgs = JSON.parse message
+      taskArgs.options.reservation_id = ironTask.reservation_id
     catch e
       logger.error 'ironTask is', ironTask
       logger.error "IVY_IRONMQ_ERROR Retrieve tasks that cannot be parsed as JSON, deleting from queue: #{ironTask}", e
-      @getQueue().del ironTask.id, {}, (err, body) =>
-        if err
-          logger.warn "IVY_WARNING Cannot delete task from IronMQ", err
-          @manager.emit 'mqError', err
+      logger.warn "IRONTASK", ironTask
+      if ironTask.id
+        @getQueue().del ironTask.id, { reservation_id: taskArgs.options.reservation_id}, (err, body) =>
+          if err
+            logger.warn "IVY_WARNING Cannot delete task from IronMQ 1", err
+            @manager.emit 'mqError', err
 
     @manager.emit 'scheduledTaskRetrieved',
-      id:        ironTask.id
-      name:      taskArgs.name
-      args:      taskArgs.args
-      options:   taskArgs.options
-      queue:     queue
+      id:             ironTask.id
+      name:           taskArgs.name
+      args:           taskArgs.args
+      options:        taskArgs.options
+      queue:          queue
 
   consumeTasks: (queues) ->
     toRetrieve = @options.messageSize or 1

          @emitConsumeTask message, queueName, ironTask

  taskExecuted: (err, result) ->
    @getQueue(result.queue).del result.id, {}, (err, body) =>
      if err
        logger.warn "IVY_WARNING Cannot delete task #{result.id} from IronMQ", err
        @manager.emit 'mqError', err


    queueName = @getQueueName queues?[0]

    @getQueue(queueName).reserve { n: toRetrieve, timeout: RESERVE_TIMEOUT}, (err, ironTasks) =>
      if err
        logger.warn "IVY_WARNING Cannot retrieve task from IronMQ", err
        @manager.emit 'mqError', err if err
