realized you had a check for no NO_MATCHED_HEADER and should only do the tempheader check if a header was matched