Fix invalid javascript