sort pending headers before they get processed