more javascript fixes