fix bug in header matching