some javascript fixes