Adds load event listener for the document