further tweak header parsing