fix induction variable update bug identified by LeartS