   throw new Error 'String required' unless _.isString xmlString
   throw new Error 'Callback must be a function' unless _.isFunction callback
 
-  xmlHelpers.xmlTransform xmlHelpers.xmlFix(xmlString), (err, result) =>
-    if err
-      @returnResult false, "Error on parsing XML: " + err, callback
-    else
-      stocks = @mapStock result.root, "TODO"
-      @createOrUpdate stocks, callback
+  @initMatcher().then () =>
+    xmlHelpers.xmlTransform xmlHelpers.xmlFix(xmlString), (err, result) =>
+      if err
+        @returnResult false, "Error on parsing XML: " + err, callback
+      else
+        stocks = @mapStock result.root, "TODO"
+        @createOrUpdate stocks, callback
 
 exports.StockXmlImport.prototype.returnResult = (positiveFeedback, msg, callback) ->
   d =

      xmlString = new Buffer(content, 'base64').toString()
      @run xmlString, cb
  else if msg.body
    @createOrUpdate([@createEntry(msg.body.SKU, msg.body.QUANTITY)], cb)
  else
    @returnResult false, 'No data found in elastic.io msg.', cb


  @_options = options
  @sync = new InventorySync Config
  @rest = @sync._rest
  @existingStocks = {}
  @sku2index = {}
  @

exports.StockXmlImport.prototype.elasticio = (msg, cfg, cb, snapshot) ->
