You have been unhappy with your marriage for years. Now, you’re planning to file for divorce. While your spouse has no idea that you’re going to file, you can easily predict how they are going to react, and they’re not going to be happy.

If you think the divorce is going to get contentious, one thing you may want to do before you file is to close your joint credit card accounts (if you are able). Then, open new accounts in only your name.

One thing to note is that you may need to pay off the balance in order to get permission from the lender to close the account. This can be frustrating if you owe a lot of money, but you can still just use joint assets to pay it, so you’re not shelling out that money yourself. You and your spouse are essentially splitting the debt since you’ll divide the remaining assets in the divorce anyway.

The reason you want to close the account is that both you and your spouse are responsible for charges on it, regardless of which spouse makes the purchase. If you announce your intention to divorce and they rack up new charges, you may find yourself having to pay off their debt or at least fighting over it in court. You also run the risk of having your spouse close the account without telling you, thus cutting you off financially when you need the money most. You can avoid both of the aforementioned outcomes by getting your own card and then breaking the news.

When divorce gets complicated and contentious, be sure you know what legal options you have.