changing scope to parameterize index name properly