fix exit issue