Fix error where it took multiple frames for the browser to attach the bo...

...dy to the document