moved JS insertion