fixed a bug in the js file