fixed a lot of javascript