Gender diversity in the tech industry is a notorious issue, leaving women consistently at a disadvantage to their male counterparts. While the conversation around women in tech has improved, women still only make up 21% of computer programmers and 22% of all other computer professionals.

The reason there are less women than men working in tech is often two-fold: Women don’t feel comfortable applying, and women don’t feel comfortable staying. The majority of women (67%) say they feel underestimated at work, and nearly 80% of global organizations say they don’t prioritize female advancement in the workplace. This lack of career growth opportunities–and highly publicized poor wages–lead many women to leave their tech careers behind.

SEE: Hiring kit: Chief diversity officer (Tech Pro Research)

This marginalization in tech leaves women unconfident in their abilities, discouraging them from applying for tech jobs in the first place. “Women are less inclined to apply to jobs unless they are 100% qualified of explained in the job description,” said Lauren Romansky, managing vice president, Gartner’s HR practice. “Whereas, men are much more inclined to apply for the job even if they don’t meet all of the qualifications that are put forth in the description.”

The only way to fix the gender diversity gap is to make conditions better for women to apply and stay. A diverse workplace doesn’t only benefit women, but the organization as a whole, Romansky said.

“Gender diverse workforces actually create results, because that’s becoming the norm of the perception of what a successful organization looks like,” Romansky said. “It becomes this self-fulfilling prophecy where we think if you are a capable, functional, successful organization, you would be gender diverse”

Here are the habits companies should avoid if they want to retain female employees.

1. Lack of benefits

If companies want to retain women, they must provide adequate benefits, and stick with them. For example, companies need to offer paternity leave to the same extent they offer maternity leave, said Liesl Bernard, CEO of executive search and staffing firm CannabizTeam.

With paternity leave, “women don’t bare the full onus or obligation of having a baby and having to deal with the dynamics of bringing or starting a family,” Bernard said. “Men can equally be involved and help lighten the burden so women have the ability to stay in the workplace longer or easier.”

Companies should also evaluate corporate benefits to allow women the ability to handle female health issues–like fertility problems–without taking up all their sick days, Bernard said. Doing so shows women that the company is “embracing the act that very often women have different health and family needs,” Bernard added.

2. Avoiding trust and transparency

Companies must be honest with their employees if they want to keep them, regardless of gender, said Maria Colacurcio, CEO of Syndio, an analytics organization that helps companies address people-related issues. But for women in particular, “if you are saying you have policies that support women with flexibility, but you’re not following those up with action, you are going to lose trust from women, and women will make the rational choice to leave,” she said.

Many companies also make the mistake of not having these conversations and not being transparent about real issues, said Bernard. If organizations aren’t able to have candid conversations about the needs of women, and subsequently not follow through on discussed solutions, then women won’t feel heard, she added.

3. Poor company culture

A healthy company culture is necessary to keep employees from quitting, and for succeeding in company-wide goals. However, a good culture is vital for women in the workplace, as women often feel isolated in the tech industry, said Bernard.

The issue with tech organizations is that “it’s an all or nothing culture. We’re still struggling in technology to allow women the flexibility to live their life in a holistic way,” said Colacurcio. “They’re forced into a position where it’s all or nothing on their career, and so their personal life is suffering.”

Women are often working a double shift, Colacurcio added, working as both professionals and caretakers, and it’s up to companies to support them. “We know statistically that caregiving, whether it’s for children or aging relatives, disproportionately falls to women,” said Bernard. Providing flexible work opportunities, and encouraging women to use that benefit, helps women feel understood and cared about, Bernard noted.

For advice on how to better recruit women in tech, check out this TechRepublic article.