Catch IllegalThreadStateException