Fix error where it took multiple frames for the browser to attach the body to the document