What are the key ingredients for startup success? This is a question I get a lot, as CEO of a legal startup. Many entrepreneurs cite courage, perseverance, financial resources, and a great team, which are of course vital to your success. However, I find that people tend to overlook the most crucial ingredient of all — the services of a good lawyer. I’m an attorney myself, so maybe I’m a little biased — but the fact is that I’ve seen too many startups fail because they didn’t stay on top of their legal affairs. So, while securing a good lawyer isn’t as exciting as snagging the next hotshot out of Silicon Valley, the truth is that nothing will sink your business more quickly than an unexpected lawsuit, contract dispute, or a competitor stealing your idea.

You don’t want to think it could happen to you, but all the same you need to get your legal house in order when starting a new business. Here are seven legal mistakes I’ve seen entrepreneurs make, which you can easily avoid by taking simple precautions.

1. Not Hiring a Startup Lawyer: From my point of view this is the biggest mistake you can make! There are many lawyers representing small businesses, but please be sure you pick one who specializes in representing startups. There’s an entire market around startup funding, and it would be all too easy for you to end up fleeced if you don’t have the experience of an attorney familiar with the world of angel investors and venture capitalists.

2. Not Having Founders’ Agreements: It’s exciting, starting up a new business. You don’t want to think that something could go wrong between you and your partners. But when dealing with money and people, things don’t always go as planned.  So how do you split the equity? Who is contributing what? Who acts as CEO? If something goes awry, you need to have your initial agreements in writing.

3. Choosing the wrong corporate entity: It might sound mundane, but deciding what corporate entity to establish is actually one of the more important early decisions you’ll need to make. Think about your long-term objectives. Different corporate structures offer different opportunities and restrictions, and trust me, changing your entity down the road is can be both expensive and difficult. So think hard about what you want, and decide now if you are going to run your business as a C Corp, S Corp, LLC, or LP.

4. Using Someone Else’s Trade Name: You might have had your company name in your head since your freshman year of college, but if someone else has claimed it, you’ll have to adjust your vision. If you don’t research potential business names before making a decision, putting up a website, and committing to advertising, you might find yourself on the wrong end of a cease and desist order.

5. Failing to Protect Intellectual Property: You are probably really enthusiastic about your great business idea. But if you start telling people about it before you have a patent application on file, you could find that your fantastic brainstorm is your competitor’s new product line, and you won’t have any legal recourse. Take it from me: identify your core pieces of intellectual property and protect them with a patent.

6. Failing to Comply with Federal or State Security Laws: If you are in position of asking even a few people for money, whether as an investment or a loan, make sure to observe the various securities laws. While you may not need to register your securities, it’s possible you’ll have to file for an exemption. An improper offering may result in regulatory fines and worse, unwinding of a transaction.

7. Not Understanding Key Contracts: If a third party is vital to any part of your business, you need to have a written contract with that party. And please, be sure you understand the core terms of the contract – this is where your lawyer will come in handy, again. Understanding the contracts you’re signing is important because in a breach-of-contract lawsuit, ignorance is not a defense.