Canada has stopped sharing secret spy information with a number of countries including the United States.

The decision was made after Canada’s spy agency discovered that its US counterpart, National Security Agency, had shared personal details of a number of Canadians. Canada said the Communications Security Establishment failed to hide the metadata of Canadian citizens before sharing it with international partners.

Canada is one of the “Five Eyes” intelligence sharing network. The other countries are Australia, New Zealand, the UK and the US.

“We want to make sure that software updates actually do what they’re supposed to do,” RT quoted Defence Minister Harjit Sajjan as talking to media. “And that’s why we have stopped that portion of metadata sharing. It’s very important that…we do protect the privacy of Canadians.”

“CSE will not resume sharing this information with our partners until I am fully satisfied the effective systems and measures are in place.”

CSE said in a report to parliament on Thursday that the unintentional breach had been revealed internally in 2013. According to a CSE official, the blame goes to a software flaw which resulted in exposing personal details of Canadian citizens.

According to Public safety minister Ralph Goodale, the allies have been “very supportive” as CSE decided to halt information sharing. The Guardian reports that it is illegal to spy on Canadians even though CSE does keep an eye on some while investigating other targets.

Sajjan appreciated the support from the allies. “They also value the same type of protection as we do, and that’s why this agreement, this very important agreement within our Five Eyes community is in place,” he said.

US whistle-blower Edward Snowden was the first one to blame NSA for spying on US citizens. He also accused the American spy agency of spying on a number of international leaders.