fix the timestep computation