defer calling things until the document is ready