index script fixes