fix the bug (index of chunk)