fix a js bug