fix a bug in index