fix index scope error