fix connection readbytes bugs