fixed a bug in index