moved scripting of index