fixed a js bug