fix up javascript