Facebook was on the verge of scrapping its $104 billion initial public offering (IPO) in 2012 after receiving poor revenue projections, according to court testimony in a class-action lawsuit.

The stress of the IPO even got the best of CEO Mark Zuckerberg, who texted his wife Priscilla Chan in fearful panic.

“Everything here is going really badly. Our revenue projection has gone down so much we now think we might go public at less than $50bn if things continue,” the text said, according to the Financial Times.

The IPO came at a pivotal moment for Facebook, which was fighting to move its platform from desktop to mobile and had spent $1 billion to purchase Instagram—an acquisition now considered one of the most “brilliant” in tech history.

Facebook is the most successful social…