fix the bug build indices every time.