Properly set the state to terminated for deleted instances