Fixed the indefinite running issue.
Merge pull request #2 from gezimbasha/master

Fixing the indefinite running