add minimal support for adding external scripts and fix rendering html after the page was loaded