envelope parsing added