fixed bug in chunked reader