You’ve successfully endured three interminable lines, solved the Tetris-like puzzle posed by a jam-packed overhead compartment crammed with roller bags, and finally sat yourself down in seat 23B. Having run the gauntlet that is a modern airport, you’re finally safe and on your way, aren’t you?

Not so fast. That’s the lesson that was driven home by a United Airlines incident this week in which a passenger was forcibly removed from a flight when the airline needed his seat for a crew member. The video of a Louisville, Kentucky, doctor being dragged down the aisle in Chicago by airport authorities, his face bloodied after hitting an armrest, has gone viral. The level of public outrage is intense, with some consumers calling for a boycott of United.

As shocking as it may seem, United Airlines was well within its rights to remove David Dao from his seat.

"They have the right to do that under the terms of carriage," explains aviation consultant and former airline executive Robert Mann. That rarely read fine print allows an airline to remove any passenger for pretty much any reason at any point before the plane departs.

Often that action is taken because the airline has overbooked the flight, but in this case United needed to get four crew members to Louisville for a subsequent flight, a situation that still seems to fall under the regulations governing overbooked flights.

To pardon the inconvenience, airlines generally start by floating some sort of payment. United reportedly offered Dao an $800 travel voucher, which was more than $500 short of the maximum outlined in the carrier agreement. Mann notes that the situation was made worse by the fact that the offer was made at the last minute rather than in the boarding area or even by a pre-emptive text from the airline.

“If you had offered four passengers $1,350 each back in the boarding area, you would have gotten the crew there on time,” he says. “What happened next is the abomination.”

Though physical altercations between passengers and airport security are rare, it’s important to remember that flight attendants and gate attendants have been given broad authority over passengers. Passengers have been arrested for merely raising their voices to ticket agents and even for insisting on using the lavatory after a flight attendant asked them to return to their seats.

But balancing these seeming abuses of power are legitimate safety considerations. Flight attendants have been trained to consider the possibility that any unusual activity on board might be a potential diversion for an attack on the airplane.

“In a post 9/11 world, the flight attendants are the first line of defense,” says Mann. “It creates a lot of anxiety in crew members’ minds.”

A look at the statistics tells a good-news/bad-news story: Bumpings are down. But air rage, on the other hand, is up.

The Department of Transportation tracks passenger bumping—the incidents are called “Involuntarily Denied Boarding”—and the stats reveal that these incidents are both rare and getting rarer. In 2016, just over 40,000 passengers were denied boarding out of a total of 660 million passengers. That rate—0.62 per 10,000 passengers—is the lowest since 2002.

United was among the best of major U.S carriers in 2016 with a rate of 0.43 bumps per 10,000 passengers, trailing Delta and Virgin America but ranking ahead of American, Southwest, and Jet Blue.

On the other hand, air rage incidents are on the rise. The International Airline Transport Association reported 10,854 incidents (1 in every 1,205 flights) last year, up from 9,316 (1 in 1,282 flights) in 2015.

Alcohol or drug intoxication was cited as a cause in 23 percent of the cases, and 11 percent involved physical aggression. The remainder? A passenger verbally abusing another passenger or crew member or failing to follow the instructions of a crew member.

One contributing factor in the increase in air rage? Class. As in first class. Katherine DeCelles, a visiting professor at Harvard Business School, conducted a study that noted that air rage incidents were more than three times more likely on a flight in which there is both first class and economy class. She noted that the rate increased even more—in both parts of the cabin—when coach passengers had to walk through first class on the way to their seats.

"Some of it is about the environment," says DeCelles. "Planes are smaller and more crowded, and you have people who are anxious and you put them in a small space with strangers.”

Given that airports and airplanes are under the jurisdiction of the federal government, air rage incidents can get serious in a hurry. Passengers who interfere with the duties of the flight crew can face criminal charges, as well as civil penalties by the FAA of as much as $25,000, although reporting by USA Today reveals that authorities rarely impose the maximum penalties.