Correct the logic of chunk method