fix seek bugs for the index