An increasing number of Indian companies – especially technology startups – are taking steps to retain women employees, starting with extended maternity leaves.

For instance, online retailer Flipkart said it would now offer 24 weeks of paid maternity leave, up to four months of flexible work hours, and the option for new mothers to take up to a year off without salary.

Here is the new policy that the e-retailer posted on Twitter on June 30:

 

“At Flipkart, we want to create a world class work environment. We want to support women employees achieve work-life balance as they continue to focus on their careers,” Mekin Maheshwari, chief people officer at Flipkart told Quartz.

“With the introduction of these policies, Flipkart aims to create a safe, secure and an inclusive work atmosphere,” he said in an emailed response.

Last month, mobile advertising startup InMobi said it would give its female employees up to six months of maternity leave.

“Today, maternity is a key milestone when significant number of women choose to stop working. However, only a few organizations in India, largely in the fast moving consumer goods or the banking and financial services space offer generous benefits to working mothers,” Rajesh Sridhar, a senior associate, human resource analytics, at InMobi, wrote in a LinkedIn post last month.

These developments come as companies in India struggle to retain female talent.

According to a 2012 Booz & Company report, though an estimated 5.5 million women join India’s workforce every year, many of them leave soon after having children, stymied by societal restrictions and discrimination and barriers at the workplace. The study ranked India 115th out of 128 countries when it comes to empowering women at the workplace.

Women are also particularly absent in the country’s boardrooms. A recent survey by Grant Thornton revealed that just 15% of leadership roles in India are held by women, an abysmally low figure that ranks the country third from the bottom in the list.

As per India’s Maternity Benefit Act of 1961, all companies are required to provide female employees with 12 weeks of paid maternity leave. But many women have complained about the discrimination they face even before they become pregnant.

Women often have to deal with intrusive questions about their pregnancy plans and also report encountering companies that blatantly shy away from hiring those who are pregnant or about to be married.

And the discrimination doesn’t end when new mothers return from leave. Working mothers are often given unimportant projects, and lesser career-enhancing opportunities, because bosses feel they cannot put in long hours.

Given the difficulties, it’s no surprise that women in India are leaving their jobs in droves.

“While providing renewed maternity benefits is a commendable step towards retaining women employees, reintegrating them back to the workforce is fundamental. It is crucial to ensure that performance management systems are fair and do not penalize women for maternity breaks,” Shachi Irde, executive director of Catalyst India Women’s Research Center, told the Times of India newspaper.

Flipkart and other startups aren’t alone in rolling out a red carpet for women employees. Some bigger and older firms have also done the same.

In May, IT firm Accenture began to offer five months of paid maternity leave to its employees, up from 12 weeks.

In June, PNB MetLife India Insurance, an insurance services firm, said it would give employees who opt to have children through surrogacy four weeks of maternity leave.

And others like Infosys plan to revamp existing policies. In December last year, Vishal Sikka, chief executive at Infosys, said the company has formed a team to simplify maternity leave policies.

This article was originally published on Qz.com.