fix index scope