Adding waitUntil method