make a detector for length of index.