patch document.ready