catch exceptions if thread is interrupted
Merge pull request #188 from sayadyan/issue_187

Catch exceptions if thread is interrupted (fixed issue #187)