Use the waitForCompletion call instead thread.join()