fixed a JS error while exporting to SVG