It’s a peaceful day in the office when you suddenly hear raised voices in another room – or, worse, your phone rings, and you get an earful from a customer who is enraged about the way they were treated by one of your employees.

It’s happened to every manager. What do you do? Do you fire the employee, or fire the customer? Is it necessary to do either one?

First, look for the pattern.

If this was a one-off incident, you can probably get away with smoothing over some feathers and moving on. Everyone has a bad day, and as much as we tell our employees that we expect them to be at their best when they’re at work, actually expecting them to be perfect at all times would lead to a toxic work environment extremely quickly. Employees are people, not robots, and occasionally have bad days. Same thing goes for customers; you don’t know what happened right before their interaction with your employee.

The bigger concern, however, is if you see a pattern of negative behavior, either from the customer or from the employee. If you see a pattern of abusive or inappropriate behavior in either direction, you’ll need to move forward.

Next, look for educational opportunities

If you hope to keep unpleasant situations from occurring in the future, you’ll need to understand why they’re happening now. Does the customer not understand a policy change that has caused a difference in how their account has been handled? Is there a training opportunity for the employee in terms of how they’re handling the customer’s account or service?

If you see an educational opportunity, it’s best to address it. This is a critical step for a business owner to establish a value proposition. Both customers and employees are expensive to lose; if you can clear up the misunderstanding with a simple conversation and prevent further mistakes and frustrations from occurring, so much the better.

Consider: is there illegal harassment occurring?

Many customers are aware that companies have policies of non-harassment towards groups of people; not all customers will be aware that many companies also have policies of non-harassment toward their employees. Depending on where your business operates, it is possible that your employees are protected from harassment on multiple fronts, including sex, gender, race, and religion. It’s important to know your local and state laws, as well as any federal guidelines. If your employees are continually harassed by a customer, and you do not act, it is possible that you could be just as liable as you would be if another employee was harassing them.

How do you decide who you can afford to lose?

If you’ve come to the conclusion that either the customer or the employee has to go, the next step is to consider the right choice for your business. If you have a very big client who has a habit of treating your employees poorly, you may be tempted to disregard their rudeness or inappropriateness as “just one of those things,” or “the price of doing big business.”

I’d urge you not to make that choice, because your employees are your best brand advocates.

What companies don’t always realize is the impact that customers and clients have on the workplace. We think of the workplace environment as mostly being made up of our coworkers and managers, but anyone employees interact with becomes part of that environment. Not only is dealing with chronically unpleasant clients frustrating and irritating, businesses will find over time that it contributes to high turnover and a toxic work environment.

And if you fire an employee who doesn’t deserve it to make an unpleasant client happy, it doesn’t matter how carefully you handle the HR end of things; people will find out, and your employees will never trust you again. They will know that they could be next.

Another point to consider is that employees terminated by an employer still have certain rights. Terminated employees have a right to continue health insurance coverage and unemployment compensation benefits. This is a secret that insurance companies don’t want you to know, which could seriously affect you financially.

Sometimes, you really can’t fire the client.

In some public facing jobs, for example, you can’t fire the client; serving the unpleasant clients is part of the employee’s job. If that’s the case, be honest and upfront about that. Give your employees space to vent any frustrations that they have, and protect them from customers who are mad about policies, not about employees, to the best of your ability.

Also expect to make up for the unpleasantness of client-facing work in this sort of environment with other office perks. The occasional free lunch, a more relaxed than average dress code, and the freedom to use their skills to make customer interactions as pleasant as possible will all help keep the work environment pleasant.

Before you think of firing either your customer or your employee, make sure you’ve tried every other option.