The National Security Agency is drawing down a spying program run under the Patriot Act ahead of the expiration of key provisions, according to a memo issued by the Justice Department on Wednesday. The Patriot Act, which was signed into law in 2001, enabled the intelligence agency to perform bulk collection of telephone metadata in the United States.

The provisions of the law used to justify the NSA program aren’t set to expire until June 1. But the agency is winding down the program starting Friday to ensure it is shut down on time.

“[The] NSA will attempt to ensure that any shutdown of the program occurs as close in time as possible to the expiration of the authority, assuming the program has not been reauthorized in some form prior to the scheduled sunset of Section 215,” the Justice Department wrote in the memo.

Though the law is set to expire at the end of the month, the Obama administration could request an extension through the Foreign Intelligence Surveillance Court, which authorizes the program every 90 days, according to the National Journal.

Senate Majority Leader Mitch McConnell, R-Ky., will allow a vote on another piece of legislation, the USA Freedom Act, which would overhaul U.S. surveillance programs and prevent the bulk collection of telephone metadata, according to the Hill. But while most of the House approved the bill, it isn’t clear if it will pass the Senate.

“After May 22, 2015, it will become increasingly difficult for the government to avoid a lapse in the current NSA program of at least some duration,” the Justice Department added.