fix accounting of bytes received