Fixed to use waitForMixed() instead of Thread.sleep()