The Leadership Insider network is an online community where the most thoughtful and influential people in business contribute answers to timely questions about careers and leadership. Today’s answer to the question: What did you learn from your biggest failure? is written by Bonnie Crater, CEO of Full Circle Insights.

Ellen DeGeneres once said, “It’s failure that gives you the proper perspective on success.” I agree. It’s no fun to pour your heart and soul into an endeavor only to see it fail, but the lessons you take away from the experience can make future success possible. I learned this the hard way about 15 years ago when I was hired as CEO of a startup during the dot-com boom (toward the end of it, as it turns out). It was my first chief executive job, and as Silicon Valley veterans will remember, that period was an exciting, giddy time — until it all fell apart.

My startup had great potential, and in that era, it seemed like the sky was the limit. We raised our Series A financing to scale up operations. I hired 100 talented people. Then the bubble burst, and like many startups, we had to shut down. It was a painful process, but I learned five incredibly valuable lessons:

Don’t run out of money
This sounds like common sense — and it is. But in an environment like the dot-com bubble, it’s easy to forget the basics. When the bubble popped, virtually everyone in the industry took a massive hit, but the companies that had the resources to ride it out were able to emerge and grow. My company didn’t have the cash on hand to keep operating, so we had to shut down — a painful lesson about the importance of managing cash.

Have a way to attain your goals
Alignment is incredibly important for a growing company. Marc Benioff at Salesforce crm created the V2MOM method to keep everyone on the same page during a period of rapid growth. “V2MOM” stands for “vision, values, methods, obstacles and measures.” Companies that intentionally create a set of goals and strive toward them get more done. I now use the V2MOM at Full Circle and it keeps everyone aligned and focused towards our goals.

See also: The Only Time It’s Okay To Pass Up a Great Opportunity

Hire the VP of sales at the right time
It may seem counterintuitive, but hiring a VP of sales before thoroughly validating the product-market fit can actually slow things down for a new company. The best strategy is to hire a team of hungry sales reps to drive new business, adjust your product-market approach based on real-world experience, and then hire a sales executive to organize everything once you have a clear sense of your objectives.

Build a five-year plan
The tech sector moves so quickly that some executives don’t see the point in a long-term plan. It’s true that evolving circumstances will inevitably require a shift in strategy, but creating a five-year plan is still an amazingly valuable exercise. It clarifies your thinking by compelling you to consider factors you may have otherwise overlooked. It helps you to see business dynamics plainly so that you’ll be better informed about financing priorities.

Be intentional about creating your company culture
Whether you deliberately create one or not, your company will develop a culture, so make sure it reflects your values and supports your objectives. I like the V2MOM as a tool to drive company culture as the second “V” stands for values. For us at Full Circle, a company culture that puts the team first, promotes transparency and enables employees to achieve a healthy work-life balance creates the trust and collaboration needed to build a company capable of going the distance in a fiercely competitive business climate.

It’s painful to fail. When my dot-com boom startup went bust, I had to disband the team, negotiate payments with vendors, and wind down operations. It was a devastating experience and a wholly new one to me at the time since I had never failed on that level before. It took years to fully put it behind me. But as hard as it was, I wouldn’t trade that experience because I learned so much from it — lessons that underpinned the success I’ve enjoyed for the past dozen years. When asked about the multiple failed experiments he’d conducted before he found the right formula for a commercially viable incandescent light bulb, Thomas Edison said, “I have not failed. I’ve just found 10,000 ways that won’t work.” This applies to managers, too. Every failure has something to teach us. The ultimate failure comes if we make the same mistake more than once.