fix headers serialization

@fosdev @sheavalentine-mdsol please review and merge. Thanks!