fixed exception on waitUntil