fix a crash bug and change the index UI