Japan is set to change a 19th-century law deciding the paternity of a child born after divorce, in a bid to reduce the number of babies who remain unregistered and face difficulty in accessing health care and education.

The Cabinet approved a bill Friday under which paternity will be awarded to the mother’s spouse at the time of the birth. The revised legislation, set to be presented to parliament for passage in the current session, will also end a ban on pregnant women remarrying within 100 days of divorce, ostensibly imposed to avoid disputes over paternity.

Under an 1898 Civil Code that’s still in force, a child born to a woman within 300 days of divorce is considered to be that of her former husband, even if she has remarried. Many women opt not to register their children rather than comply with the regulation, especially in cases of domestic abuse.