Refine app quiting action.