added template envelop