added header parsing