Oil prices are falling again after a few weeks of recovery.

Traders have noted that stockpiles are continuing to add on to what are already record inventories. This put a halt to a continued rise in oil prices over the past few weeks, thanks to declining output from the Organization of Petroleum Export Countries and the United States.

But while oil traders may be disappointed, this would seem to be good news for the U.S. economy. For years, politicians and consumers have griped about the high price of oil and how it hits consumers in their pocketbooks.

Now that gasoline prices have fallen below $2 a gallon in much of the country, consumers will have more money to spend and stimulate the rest of the economy.

Except it isn't that simple.

Although low energy prices are still better than high energy prices, a continued decline should worry investors about the possibility of smaller oil companies going bankrupt and the harm that could do to the market.

End of a Boom

The rise in oil prices and the development of shale oil created conditions where workers from across the country would rush to boom towns in search of well-paying jobs. Spotters with just a few million dollars of investment could hope to strike it rich drilling for oil, creating hundreds of small exploration and production companies.

But many of those companies that flew high a few years ago have crashed.

According to the law firm Haynes and Boone, 51 E&P companies have filed for bankruptcy since the start of 2015, with nearly half of them in Texas.

Just eight companies filed for bankruptcy in 2014.

Furthermore, companies that aren't going bankrupt are still shedding jobs.

More than 319,000 oil workers have lost their jobs since late 2014, with much of it coming from drilling and E&P jobs. And because the oil boom has been largely localized to a few states, they are feeling a disproportionate pinch from the decline in jobs and the loss in oil taxation.

In addition to just staying away from energy companies for now, investors should also be worried about investing in companies whose businesses are centered in states that have been hit hard by the oil decline, including Alaska, Louisiana, North Dakota and Texas.

Energy is so much more than oil, and investors in green energy should also be concerned about the profitability of solar and wind as a result of low oil prices.

In the 1980s, low oil prices shut down early efforts to develop renewable energy, and there are warning signs that this could happen again. Automotive and energy storage company Tesla Motors  (TSLA - Get Report) stock has fallen recently as investors remain skeptical about its plans to manufacture a mass-market sedan, and solar energy stocks such as SunEdison (SUNE)  have taken a beating over the past year.

But this slump in oil prices isn't an automatic death knell for green industries and could in fact present a major opportunity.

Investors should also remember that while these companies may seem to compete with traditional energy companies, renewable investments are generally concerned with producing electricity such as solar and wind. Oil accounts for just 5% percent of electricity generation in the United States and is generally used for transportation or heating instead.

And despite the low price of oil, investment in green energy continues to grow on a global scale. In Australia, renewable energy has been a major source of economic growth, for instance.

Politicians across the world are intent on avoiding the mistakes of the 1980s, and the capital costs of solar and other forms of renewable energy continue to decline. As long as investment remains high and the importance of green energy continues, these companies have little to fear from continued low oil prices.

Cautious Optimism

Although cheap oil may no longer be the boost to the American economy that it once was, the overall effects are still positive. Lower energy prices have given a boost to consumer spending, which has kept the economy afloat and will reduce the amount that America has to spend importing foreign oil.

But though investors should feel optimistic about energy prices as well as other positive economic news, they should still look out for storm clouds on the horizon. As energy companies go bankrupt and harm state economies throughout the United States, this could cause a ripple effect of more bankruptcies, job losses and a decline in consumer spending.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.