repair waitForJsonRequest()