update envelope.js