Check the document.readyState if its already completed