added field and made decoding more robust to missing fields