fixed bug due to assumption that chunks will always be sent at proper sizes