When Congress fixes one problem, it often inadvertently creates another one. This is the story of one such inadvertent problem.

For years most major tech firms in the United States found it necessary to fight numerous patent battles, both with each other and myriad other entities asserting that various innovations somehow infringed on a patent they acquired with the intent of obtaining some sort of legal settlement. Most of these claims had little merit and this needless litigation complicated research and development in the IT sector of the economy, which has been a driving force for the U.S. economy.

Congress belatedly came to conclude that it had become too easy for businesses to acquire patents for technologies solely to litigate.

Seeing this problem solely through the prism of the tech sector, Congress enacted the America Invents Act. One major facet of the legislation was the creation of something called Inter Partes Review (IPR), which is a streamlined process for invalidating worthless patents. While it did not completely eliminate bruising patent fights over dubious alleged patent violations, the tech industry has been generally satisfied with the outcome. But while this may have solved a problem in the tech sector, the law inadvertently opened up a can of worms in the pharmaceutical sector by giving the manufacturers of generic drugs new opportunities to pursue litigation against the major drug manufacturers.

U.S. patent law grants pharmaceutical companies a relatively short window in which no one can produce and sell a drug identical to one that is on patent. Once drug patents expire, the makers of generic drugs can sell an identical version of the real drug, which typically serves to greatly reduce prices. The Hatch-Waxman Act, which sets out most of the rules governing generic drugs, grants a few limited exceptions whereby patents can be extended, but its intent is to preserve the incentive to innovate new medicines while creating a copasetic environment for generics drugs.

Generics tend to dislike most of these exceptions, and they often fight pharmaceutical companies’ attempts to extend their patents in this way.

The America Invents Act essentially created a new channel for generic drug companies to challenge drug patents via the IPR. Its inception has served to greatly complicate the legal drug market by allowing generic drug manufacturers to challenge patents both under the terms spelled out in the Hatch-Waxman Act as well as via IPR for the same drug.

The IPR process also tends to favor the patent challenger by making it inexpensive and relatively straightforward to file an IPR challenge: The review occurs in front of a patent review panel, and with evidentiary standards markedly lower than Hatch-Waxman proceedings. IPR has even begotten what is essentially a “reverse patent troll,” whereby hedge fund investors file illegitimate biopharmaceutical challenges in the hope of either receiving a drug company settlement to make the nuisance go away or realizing a gain from short positions in companies they target.

This outcome was not the intent of anyone who crafted the legislation, and the result has been higher drug prices as well as lower investment in drug research and development.

Last month Rep. Bill Flores (R-Tex.) and Sen. Thom Tillis (R-NC) introduced a bill, the Hatch-Waxman Integrity Act, that would largely curtail frivolous repeat challenges by precluding patent litigators from pursuing dual litigation strategies via both the courts and the IPR. It may not be a complete solution to this problem, but it would be a good and inexpensive start.

It is difficult to create a system that both incentivizes innovations of the sort we have seen in the drug market while also attempting to keep prices affordable for Americans. Insurance is our (very imperfect) solution but it is worth remembering that before we take further steps to restrain drug prices, we should remember that the U.S. system produces most of the world’s health-care innovations, and most citizens get access to life-saving drugs in this country.

We should take care that any reform in the drug market maintains both aspects of our health-care market.

Ike Brannon is a former fellow with the George W. Bush Institute as well as a former chief economist for the House Energy and Commerce Committee. His work has appeared in The Weekly Standard, Financial Times, The Wall Street Journal, USA Today and The Hill.