added some javascript fixes