fix general loop

fix general loop
Merge pull request #87 from Bonbons/patch-35

fix general loop