fix issue with reads greater than buffer size