fix exit application crash