add script and update index