fix exit crash