fixed bug in class Envelope