put scripts in end of document