Fixed IllegalThreadStateException