fixed a problem with the javascript