Fixed concurrency issue and js to xml conversion