fixed a bug with the JS