support exit func.