Fixes document.body is null error