add chunked mode and example