The share of people getting married in China is falling, and the divorce rate is rising—two trends that are worrying not only Chinese parents, but also officials.

Last year, over four million couples divorced—a 8.3% increase compared with 2015, according to recent data (link in Chinese) from China’s ministry of civil affairs. Meanwhile, China also saw marriages continue to decline, with 11.4 million couples getting married in 2016—around 800,000 fewer than the previous year.

China is trying to campaign against both trends, worried that an aging population, and large numbers of single men thanks to a skewed sex ratio, could harm social stability. In December, China’s president Xi Jinping called family ”an important foundation” for social harmony.

Last year (link in Chinese), China’s Supreme Court recommended trial reforms for divorce proceedings. It urged courts to distinguish between “marital crisis” and “marital death,” and to try resolve the former in order to “promote a healthy and harmonious” society (link in Chinese). The Supreme Court has selected 118 local courts to pilot the changes, which include requiring “cooling-off” periods, according to Jiang Xinru, a judge in charge of family-related cases from Anyue county of China’s southwestern Sichuan province. In March, the Anyue court issued the province’s first (link in Chinese) three-month long “cooling-off period” court order.

Judge Jiang has argued the pilot program is necessary because millions of divorces every year could lead to many social problems, such as juvenile crimes and “left-behind” elderly people. But the “cooling-off period” is applicable to certain cases only, he said. For example, judges should consider ordering such periods when there’s hope for the couple to get back together, such as in the case of a young couple filing impulsively filing for a divorce after a falling out, said Jiang. If the couple disagrees, the court should not issue such an order, he said: “The policy differs case by case.”

Similar waiting periods exist in several countries, including South Korea, Germany, Switzerland, for example as well as some parts of the US.

On Aug. 14, a district court in China’s central Anhui province issued a court order with a three-month waiting period for a couple who had been married for 10 years. The wife filed for divorce in late July, citing neglect, according to the order. “Family is a culture… There are so many good memories of youth and romance all along.” the court wrote (link in Chinese) in the order, “You have a solid relationship foundation, so you should all take a step back and keep calm when there are conflicts in your marriage.”

In some cases, judges are issuing these orders in cases that would appear to be suitable for immediate proceedings because of the possibility of harm to the woman. Also in August, the presiding judge of Jiangsu court agreed to a waiting period (link in Chinese) in a divorce petition a woman had filed because her husband often drank and beat her up. The judge said he was persuaded to issue the cooling-off order because the husband signed a letter saying he would give up drinking and learn from his mistakes, and the wife was willing to give him another chance.

Some judges are also actively pursuing mediation. A local judge from Kuytun county in China’s far-west Xinjiang Prefecture has held sessions with one couple seeking to divorce four times since late July. One time, the judge called the wife, who had brought the divorce petition, after work, and conducted an hour-long talk (link in Chinese). The couple still ended up splitting.

Meanwhile Chinese state media have been messaging women about the importance of marriage and family. China has recently loosened its one-child restriction in the hopes that people will have more children. Local governments and state media have campaigned about the virtue of “woman returning home” in recent years, noted the non-profit group Human Rights Watch in late August. In 2015, a district branch of Beijing’s civil affairs hung a poster at the marriage registration office that said “being a good housewife and good mother are women’s biggest achievements.”