detecting index