fix bug with integrator not being reset properly