Pakistan’s parliament on Wednesday passed a controversial bill allowing the use of electronic machines to vote. The opposition has said the policy is an attempt to rig the next election.

Lawmakers also passed a bill to grant expatriates the right to vote. The bills have yet to be promulgated by President Arif Alvi, a formality.

The opposition wants the elections to continue under a decades-old system that includes paper ballots and manual vote counting.

In his speech before the bills were passed, opposition leader Shahbaz Sharif said Prime Minister Imran Khan was trying to manipulate the results of the upcoming parliamentary elections in 2023. Bilawal Bhutto Zardari, who heads the Party of Pakistani opposition people, have warned of boycotting an upcoming election if electronic counting machines are used.

Khan, who was in parliament, defended the legislation, saying he wanted to ensure free and fair elections. Khan said millions of Pakistanis abroad should have the right to vote for any candidate they choose.

Khan came to power in the 2018 parliamentary elections.

The latest legislation comes amid Khan’s growing unpopularity amid a sudden spike in food prices.