fix use of range() so that retry_times is actually reached
Merge pull request #2 from kvar/master

fix use of range() so that retry_times is actually reached