@vpisarev, you remember to set flags ```hdr.flags = flags;```