Fixed a bug in index