fixed issue
fixed chunking logic