update headlessCanvas.js