Walgreens is under fire this weekend for the actions of one of its pharmacists.

Nicole Arteaga, an Arizona first-grade teacher, learned nine weeks into her pregnancy that there was no heartbeat and she wouldn’t carry to term. Her doctor gave her the options of having surgery or taking misoprostol, a prescription medication that can be taken to end an unviable pregnancy. Misoprostol is Food and Drug Administration approved to terminate a pregnancy within the first 10 weeks, according to The New York Times. 

Arteaga dropped off the prescription and when she returned to pick it up, the pharmacist on duty asked if she was currently pregnant. When she said yes, he refused to give her the medication because of his “ethical beliefs,” according to Arteaga’s viral Facebook description of the experience.

Last night I went to pick up my medication at my local Walgreens only to be denied the prescription I need. I stood at the mercy of this pharmacist explaining my situation in front of my 7 year old, and five customers standing behind only to be denied because of his ethical beliefs. I get it we all have our beliefs. But what he failed to understand is this isn’t the situation I had hoped for, this isn’t something I wanted. This is something I have zero control over. He has no idea what its like to want nothing more than to carry a child to full term and be unable to do so.

Walgreens said it contacted Arteaga and apologized to her for the way it was handled, but confirmed that the pharmacist had behaved according to company policy.

“To respect the sincerely held beliefs of our pharmacists while at the same time meeting the needs of our patients, our policy allows pharmacists to step away from filling a prescription for which they have a moral objection,” the company said in a statement.

Arteaga updated her Facebook post over the weekend saying her prescription was transferred to a different Walgreens, and it was filled “with no problems.”

Arizona is one of six states that allows pharmacists to not fill prescriptions because of “religious or moral objections,” according to the National Women’s Law Center.