waitForJsCondition fix