add chunking logic