A gay man has won legal recognition of his common-law marriage to his partner, who died two months before the U.S. Supreme Court expanded the definition of marriage to include same-sex couples.

The Pennsylvania Superior Court on Monday overturned Beaver County President Judge John D. McBride’s ruling that Michael Hunter and Stephen Carter were never legally married. Carter was killed in a 2013 motorcycle accident shortly before the high court struck down the Defense of Marriage Act’s definition of marriage as a union between a man and a woman.