Changed how javascripted are inserted in DOM