Wait for document to be ready for control to be ran