fixed up some javascript