; and (ii) in the case of a facility that is owned by the Department of Homeland Security— (I) issue a written warning to the facility not later than 30 days after receiving such notification from the Inspector General, which shall include proposed remedial measures to be carried out not later than 60 days after the issuance of the warning; and (II) not later than 60 days after the issuance of the warning described in subclause (I), certify to the Inspector General that the remedial measures have been carried out. (B) Subsequent failures In the case that the Inspector General determines that a facility has failed to comply with the standards under section 2 in two investigations under paragraph (1) during any 2-year period, and that such noncompliance constitutes a deficiency that threatens the health, safety, or the due process rights of detainees, the Inspector General shall notify the Secretary of Homeland Security of such finding, and the Secretary shall— (i) in the case of a facility that is not owned by the Department of Homeland Security, not later than 30 days after receiving such notification, transfer each detainee to a facility that does so comply, and terminate the contract with the owner of the facility