make sure defered script are loaded before small portion of javascript inserted at the end of page during processing