correct a js bug