fix bad elements ref and add script tag to index.html