Fix bad javascript