fix the bug, cause of indexing