add script tag for newly defined directive on index page