fixes to envelope