fixed endless loop
Merge pull request #5 from wgr1984/master

fixed endless loop