By Zach Ferres, CEO of Coplex.

It's not fun to cut a check for insurance every year, but it's one of those things you just need to do. Trust me on this one. It was an unseasonably warm day in our Los Angeles office back in mid-2015 when I got the phone call: "Zach, it's looking like you guys are going to have to file Chapter 7 or Chapter 11." Bankruptcy? It felt like someone had handed a death sentence to everything I had built over the past four years.

As I paced our parking lot and stared into the distance at the Hollywood sign, the only thought bouncing through my head was how I would break the news to my family and worse, our team members, partners and clients. It was one of the scariest and most stressful days of my career.

A Costly Error

After spending more than $300,000 in cash for legal fees to fight an arbitration case stemming from a big project we did back in 2009, we lost. To complicate matters further, the project was signed and completed during a six-month period during which we were not insured. This meant we had to pay out of pocket to fight the case, including the plaintiff's legal fees and damages of close to $1 million.

As a company that only did about $4 million a year in revenue, we had to make some difficult decisions. I wasn't a company owner at the time, but I was running the company as CEO. I turned to the internet to see if anyone offered loans to cover hefty lawsuit losses. When that didn't work, I sought guidance from my mentors. Most of the advice I got was "run," but I didn't see that as a viable solution.

The better idea was to purchase the company from the founders. Raising capital from new equity partners, securing money from a bank, and striking a fair deal with the founders amid a ticking clock on a pending settlement wasn't the most pleasant experience, but it forced me to grow a lot as an entrepreneur.

Lessons Learned

While things eventually worked out for us, something as small as a lapse in insurance nearly killed our company. Here are a few tips to help you avoid a similar situation:

  1. Carry good insurance. I can't stress this enough: You should look at insurance as you would any other company asset. A 2015 study showed that more than 40 percent of small businesses will likely endure an insurance or liability claim in the next 10 years.
  1. Realize the importance of GAAP financials. My company didn't understand the value of generally accepted accounting principles, and we didn't properly recognize earned revenue. That mistake caused a two-month delay in our process to close the deal.
  1. Be a CEO, not a manager. I learned to focus on maximizing the valuation of our company, and that led to a huge shift that altered my vision of the organization. I realized that a growth company CEO should aim to work on the business instead of solely in it. You should fixate on your company's purpose, goals and strategy instead of day-to-day operations.
  1. Meditate. Headspace and training for a Ragnar race saved my sanity while I worked through this legal quagmire. Even during the most trying times, allow time to soak in the experience and learn from your situation. This tough time helped me grow as a person and actually inspired one of my favorite pieces.

As crazy as it sounds, I'm happy this happened. I ended up owning the company and learning invaluable lessons along the way. We saved our team, our clients, and our company. Most importantly, the experience caused me to speed up our transition to a startup studio and accelerate our five-year vision to create a one-year plan.

Zach Ferres is the CEO of Coplex, a Los Angeles- and Phoenix-based startup studio focused on truly collaborative design and development.