Attorney General Richard Blumenthal and Comptroller Nancy Wyman announced Wednesday that Wal-Mart has agreed to dispense emergency contraception at its Connecticut stores. Wal-Mart came up with a plan to guarantee that even if one of its pharamcists is uncomfortable dispensing the birth-control measure, it’s still able to give women access to their prescription.

In cases where a pharmacist declines to dispense the prescription, the pharmacist will attempt to locate another Wal-Mart pharmacist, or make arrangements for the customer’s prescription to be filled at another nearby Wal-Mart or other pharmacy. The agreement comes four months after Wyman, who administers the health insurance plan for 188,000 state employees, retirees and their dependents, threatened to exclude Wal-Mart from the state’s insurance network. “I am gratified that Wal-Mart has agreed to do the right thing for all women in Connecticut and their families,” Wyman said in a press release. “Whether it is Plan B or any other prescription, I believe medical decisions should be made between a patient and a physician, not a pharmacy.”