move document.body.appendChild call