fix bugs: index and name comparator