The gas-rich nation of Qatar, one of the wealthiest countries on the planet, has just passed a law barring employers from forcing domestic workers to work more than 10 hours a day and six days a week.

Sadly, human rights groups consider the new law a win given that Qatar has long subjected domestic workers, almost all of whom are poor migrants, to slave-like conditions.

The law passed Tuesday also states that people working as maids, nannies, cooks, and other domestic staff are entitled to breaks for meals and worship, three weeks of annual leave, and protection from psychological and physical harm. Under the law, domestic workers will have formal contracts with employers and also have a right to an end-of-service bonus. The law will affect between 200,000 and 300,000 workers.

In addition to allowing for long, 60-hour work weeks, the law has other shortcomings. Migrant-Rights.org, a Middle Eastern advocacy organization for migrant workers in the region, pointed out in an analysis of a draft of the law that it doesn’t specify if domestic workers are allowed to leave the house on their day off. Rothna Begum, a women’s rights researcher at Human Rights Watch, told the Guardian that the government still needs to “ensure there are strong enforcement mechanisms” for the law. And there’s no indication that domestic workers are exempt from Qatari regulations requiring foreign workers to get permission from their employers to switch jobs or leave the country.

While the law means domestic workers will still be working long hours and remain vulnerable to exploitation, it is a substantial improvement over the status quo. Previously, domestic workers often didn’t work under a formal contract and weren’t able to file complaints with the country’s labor ministry if they were mistreated or abused.

A Guardian investigation in 2014 found that employers regularly subjected domestic workers to “slave-like conditions,” often making them work 100-hour weeks, physically and sexually abusing them, and withholding their wages and passports. The investigation found that hundreds of Filipino workers sought sanctuary from intolerable working conditions by fleeing to their country’s embassy in Qatar.

Qatar has a reputation for exploiting workers — and it wants that to change

Qatar is also infamous for exploiting migrant construction workers. In the summer of 2013, dozens of Nepalese workers died from heart attacks, heart failure, or workplace accidents, many of them on projects related to the World Cup, which is slated to take place in Doha in 2022.

About 70 percent of Qatar’s population of 2.7 million people are low-skilled workers, almost all of whom are migrants.

Doha’s decision to give domestic workers labor rights is in part a response to international scrutiny. The International Labor Organization, a United Nations body, had given Qatar until November to improve its labor conditions. Had Qatar not complied, it could have been hit by UN sanctions and suffered further damage to its international reputation. The country is already suffering from the impact of a Saudi Arabian-led embargo tied to Qatar’s relationship with Iran and history of supporting terrorist groups in the Middle East.