fix index  bug