Fix bug with overwriting the last script tag