fixed errors in script in index