fix header decoding