fixing bad js