replace headers appropriately