           else
             log.info "CODAP returned an error on 'create item''"
             # Re-add pending data in case of error.
-            @queue = pendingData.concat @queue
+            @queue = sampleData.concat @queue
         @codapPhone.call(createItemsMessage, createItemsCallback)
 
 

      }

  addData: (data) ->
    @queue = @queue.concat data
    if @_shouldSend()
      @_sendSimulationData()
    else



  _sendSimulationData: ->

    # drain the queue synchronously. Re-add pending data in case of error.
    sampleData = @queue
    @queue = []

    createItemsMessage =
      action: 'create',
