fix a iteration
Merge pull request #660 from minorua/grad_it

fix a iteration