fix issue with chunk length