fix issue for generator if % result a 0