updated to useChunkedMode