fix some syntax on javascript though the browser is tolerant