fixed some javascript