Career setbacks can be a real bummer no matter what your profession. For scientists, proposals that fail to gain funding and research efforts that hit dead ends can force them to shelve years of hard work. It’s these failures, and the future careers of scientists that endure them, that is at the heart of a new research paper published in Nature Communications.

For the study, researchers looked at the records of scientists who had applied for research grants from the National Institute of Health over a 15-year period from 1990 through 2005. What they found was that, contrary to what we might think, huge setbacks early in one’s career doesn’t necessarily hinder long-term aspirations, and in some cases, it appears to actually increase the chances of future success.

Because there’s no single metric for success, the researchers had to invent their own criteria for what would be considered success and failure. To start, they split scientists into groups based on whether they just missed out on funding or just barely scored high enough on their proposals to gain the requested funding.

Then, they looked at future work done by the individuals in both groups, tallying the number of citations their future publications received from other scientists. The more time their work was referenced, the more successful that research was deemed to be.

As it turns out, the researchers who had barely missed out and “failed” in an earlier attempt at gaining funding but stuck with their work had even greater success later in their careers, with their future work gaining significantly more attention than the work of their peers who saw early success.

“The fact that the near-miss group published more hit papers than the just-made-it group is even more surprising when you consider that the just-made-it group received money to further their work, while the near-miss group did not,” Benjamin Jones, co-author of the study, said in a statement.

It’s worth noting that the attrition rate among the group who experience early failures was slightly higher than those who saw success right out of the gate, but the percentage wasn’t significant enough to account for the increase in success among those who remained. The researchers note that failing early in their career may have taught those scientists valuable lessons that were applied later, or that coming up short in previous research efforts made them more determined to do exceptional work going forward.