fix parseHeader and pasreCookie