added some javascript functionality