Adding try-block to catch IllegalThreadStateException
Merge pull request #258 from sagarl/master

Adding try-block to catch IllegalThreadStateException