fixing the way to parse the header