fix rare bug when read bytes < chunksize, but more follows later