added extractEnvelope option to client