Adding try-block to catch IllegalThreadStateException
Merge pull request #256 from sagarl/1.1

Adding try-block to catch IllegalThreadStateException