same fix from double integrator, but for pendulum example