added parsing of the envelope;