add early exit