Virginia senators have passed a bill allowing condemned inmates to be executed via the electric chair. The legislation comes amid a nationwide shortage of lethal-injection drugs, though Democratic Governor Terry McAuliffe has not said whether he will sign it.

The bill won approval in a tight 22-17 vote in the Virginia Senate on Monday. If Governor McAuliffe vetoes the legislation, lawmakers will have to somehow garner more support to override it and pass the bill into law. It is expected to be sent to the governor this week.

Supporters say that death penalty abolitionists are making it difficult to obtain lethal injection drugs. Democratic leader Senator Dick Saslaw said that when offenders murder multiple people, they no longer deserve to be treated humanely.

“When you commit acts like that, you give you up your right to as far as I’m concerned to say well I want to die humanely,” Senator Saslaw told the Associated Press.

Virginia is one of at least eight states allowing electrocutions, but it currently gives inmates the choice of dying by lethal-injection or the electric chair. If they decline to make a decision, they receive the injection. The bill would allow the state to use the electric chair if lethal-injection drugs are unavailable.

Drug manufacturers have protested the use of their drugs in executions, forcing many states to pass laws bringing back other methods, such as electrocutions and firing squads, which can be used when the drugs are difficult to obtain. Last April, Oklahoma became the first state to legalize using the gas chamber if lethal-injection drugs are not available or found to be unconstitutional by the US Supreme Court.

Despite these newly reapproved methods, none of the states have employed them since they were passed. Opponents say the electric chair bill will undermine the death penalty by putting the constitutionality of the law at risk.

“There is no humane way to kill another human being, but it is our opinion that electrocution is worse than lethal injection,”Michael Stone, executive director of Virginians for Alternatives to the Death Penalty, told NBC News. “You’re basically cooking a human being while they are alive.”

State supreme courts in Georgia and Nebraska have ruled that the electric chair violates the ban on cruel and unusual punishment.

The impending execution of convicted murderer Ricky Gray in Virginia was the impetus behind introducing the new bill, as the state has said it doesn’t have enough drugs to put him to death.

The Republican-dominated House approved the bill 62-33 in February. The measure faces a final vote in the House before going to McAuliffe because of a minor amendment approved by the Senate.