fixed loop typo - issue #5