fixed hanging problem
Merge pull request #640 from hhovsepy/master

fixed hanging problem