fixed receive memory bug