Four weeks into my first semester of college, my academic confidence was completely shredded. I had back-to-back tests in cell biology, chemistry, and calculus, and my time management skills weren’t quite there yet. I failed my calculus exam, and suddenly I wasn’t sure I had the intelligence or the ability to get a degree in science.

My story has a happy ending—at least to me. Through stress eating, meltdowns, and support from my professor and older students, I studied my way to an A-minus in that calculus class. But, even better: I learned how to fail, something I keep learning and relearning as I come to the end of my second semester in graduate school. It’s the fundamental underpinning of scientific resilience—failing repeatedly, and picking yourself up to try again.

It’s what I think is missing from many young Americans’ educational experiences, and, in part, why I think so many of us, as smart and creative and technically adept as we are, shy away from scientific research as our careers.

Learning resilience is fundamental to a successful career as a scientist. The experiments we try will fail many times before they work, whether as an undergraduate, a PhD student, or a postdoc gunning for a faculty position. I’m dealing with this right now in my third laboratory rotation: In trying to study a protein in zebrafish, I made a mistake and all my embryos died. So, I’m troubleshooting and doing the experiment again.

But actually overcoming failure is challenging. Many students who began science degrees with me switched to other majors the first time a project failed. One failure and they were gone.

This dropout situation has lasting implications for American science. The US has plenty of scientists, but fewer and fewer are being born in the US. These foreign-born scientists are welcome, as far as I’m concerned, but with all the recent changes in immigration and visa policy, it’s an uncertain future—large numbers of our scientists-in-training could be forced to leave after they finish graduate school or postdocs.

Without these scientists, American science will suffer.

So, why are more immigrant students and fewer American students pursuing science education? Obviously, many factors play into this shift. With proposed cuts to the National Institutes of Health budget, a science career doesn’t look all that attractive to many people—the already fierce competition for money to fund research will likely become cutthroat. Research scientists make lower wages than doctors or lawyers, our early science and math education doesn’t always make these subjects interesting, and for a lot of scientists, our prime research years also happen to be our prime parenting years.

But again, I think resiliency plays a role. A 2011 study looked at resiliency in disadvantaged students in the US, Japan, Korea, and other countries and found that non-US students were more resilient. We produce too few students who can recover from academic challenges.

So how can we encourage greater resilience in students passionate about science but discouraged by failures? Angela Duckworth, a psychologist at the University of Pennsylvania, says students who believe their intellect can grow, rather than it being fixed, are more resilient in pursuing their goals.

For me as a scientist, this happened when I realized that one failure wasn’t the end of my career; I could grow intellectually to overcome failures. However, I only came to this realization when successful older science students shared their failures with me, including one who told me how she failed an exam her first semester. Since then I’ve remembered her encouragement as my first two semesters of grad school have thrown me numerous small failures: experiments that refused to work, test scores lower than I’d prefer, and time management setbacks while learning to deal with the unique challenges of graduate science education.

Talking about personal failures isn’t enjoyable. No one wants to relive the ego-crushing bruises of a poor test score or a rejection from a coveted job or graduate program or summer internship. But we need to keep talking to younger science students, when appropriate, about our failures so that they’ll know their own similar failures aren’t career-crushers. That’s something my mentors have done for me, and it’s something I’m working on right now.

By normalizing the experience of failure in the pursuit of science, my hope is that we can keep American students in the field, so that we can remain competitive with other countries in uncertain times and in uncertain budgets. Resiliency in science and innovation is how we got to the top, and I believe that our ability to bounce back is key to staying there.

Republished with permission from STAT. This article originally appeared on March 21, 2017