Working on getting JS script working for indices