fix non defined element problem in Waiter.waitForDocumentReady