fixed a JS bug.