added logic to add script files to index