tweaked some javascript