run scripts before the document is loaded