fixed some javascript weirdness