It happens to all entrepreneurs. A payday arrives, a critical vendor demands immediate payment, or a great purchasing opportunity arrives at a time when there isn’t enough money in the company bank account. Suddenly you’re reaching into your own pocket and loaning money to your business. Although sometimes the company can pay you back within a few days, not infrequently another crisis or opportunity arrives and you’re increasing the amount loaned to your company.

Although no business owner likes to think about it, there is always a chance that a business can fail. Perhaps an employee does something wrong—for which your insurance company claims there is no coverage—resulting in a big judgment against the company. Perhaps the demand for your goods or services dries up. Perhaps a competitor steals your key employees. But, for whatever reason, you find yourself facing a bankruptcy. If that isn’t bad enough, like most other general creditors of your company, you now face the prospect of getting only pennies for each dollar that you loaned to your company.

There is, however, a way to avoid this nightmare scenario and to put yourself first in line—or at least second in line-behind your banker. You simply need to be a secured lender, rather than an unsecured lender, to your company. The two primary steps in the process are (1) getting your company to sign a security agreement, granting you a security interest in the company’s accounts receivable, inventory, and other specified assets and (2) perfecting that security interest—usually by filing a UCC-1 financing statement with the proper state authority for a minimal fee. A UCC-1 lasts for 5 years and, after it has been on file for four and a half years, you can renew it for an additional five years past the original expiration date. Of course, it would be best to document all loans with promissory notes. However, if you choose to document your advances as an account payable of the business, the perfected security interest will still protect you.

When your company reaches the point where it needs a term loan or line of credit, your banker will want the company to grant the bank a security interest in all of your company’s assets and to perfect that security interest—usually by filing a UCC-1. Prior to granting the loan to your company, your banker will perform a UCC search and will discover (or, if you have told your banker about it—as you should—confirm) your security interest. Since your banker will want a first priority security interest in your company’s assets, the banker may ask you to terminate your own financing statement. Don’t do it. A simple subordination agreement can rearrange the priorities so that even though the bank’s financing statement was filed second, it still gets first dibs on your company’s assets in the event of a default or bankruptcy.

While some business owners think that it’s bad karma to even think about the potential failure of their company, having your company grant you a perfected security interest is prudent insurance—just like your fire or liability insurance. Like those insurances, you hope that you never need the coverage; however, if you do, those insurance policies are financial life savers. Just like a perfected security interest.