Sherri Shepherd may have a few more battles ahead, but she’s won a very important one. Amid the news that her estranged second husband is moving to file in their dispute over their unborn baby born to a surrogate, Shepherd has won her first victory in court.

Her ex-husband, Jeff Tarpley, wanted to modify custody of their 9-year-old son, Jeffery Jr. Tarpley claimed Shepherd is an unfit mother and wanted to move the child to L.A. where he is raising two sons with his girlfriend.

However a Los Angeles judge refused to grant Tarpley’s motion, and Shepherd will retain physical custody of their son. The judge, Michelle Williams said, according to documents acquired by People.com, that “there has not been a material change in circumstances.”

It has been a tough year for Shepherd. Her seven-year stint on The View ends in August as did her marriage to second husband Lamar Sally.