FREDERICK, Md. (WJZ) — Sentenced to 20 years behind bars. A judge says a Frederick County mother failed to prevent her husband from killing their 21-month-old toddler. The gruesome cases prompted reform in Maryland’s child welfare laws.

Christie Ileto explains the sweeping changes in place to protect the state’s most vulnerable.

READ MORE: COVID-19 In Maryland: More Than 1K New Cases & 17 Deaths Reported Sunday

Anayah’s Law passed this session, giving social workers more flexibility in whether or not to send a child back to an abusive home–something that was not in place when Anayah was still alive.

The state law was flawed when it allowed then 21-month-old Anayah Williams to return home to her parents, despite indications of earlier abuse. Three weeks later, police say she died.

“Because the way Maryland law was formulated, because her abuse was not chronic,” said Delegate Kathy Afzali, (R) District 4A.

That broken system is about to change. Anayah’s law is on its way to the governor’s desk.

Del. Kathy Afzali sponsored the bill.

“What this law seeks to do is give discretion to Social Services so that they can look and see the situation in the home,” she said.

READ MORE: 5-Year-Old Grazed By Bullet In Southwest Baltimore, Police Say

Anayah had been in foster care for 18 months following abuse that included a skull fracture, later causing cerebral palsy.

Her mother, Stephanie Williams, was just sentenced to 20 years for failing to prevent her husband from killing their own child. Her father, Frankie, faces child abuse and murder.

Still, this new law means another layer of protection.

“We really want to be able to allow a new degree of flexibility there to be able to keep kids safe, even if unfortunately that means that child’s not going to get to go home. But fortunately, it may be the difference between life and death,” said Adam Rosenburg, Baltimore Child Abuse Center.

Making sure this once flawed system doesn’t fail another Anayah.

Anayah’s father, Frankie Williams, goes to trial next month.

MORE NEWS: COVID-19 In Maryland: 1.5K New Cases & 17 Deaths Reported Saturday

Governor Hogan has said he will sign the bill.