prevent endless loop
Merge pull request #2 from jarnik/master

prevent endless loop