Fixed a JS bug