Twitter shares fell 20.5 percent in a single-day drop during this week’s bloodbath for social media companies. It was the worst single day percentage drop since 2014 for the company, and the second worst in Twitter’s history. Before the steep decline, Twitter’s stock had risen 79 percent in 2018. The news comes just after Facebook lost $120 billion in market value following the release of its earnings report.

The steep fall in market value comes as the company posted a record profit for the quarter. Twitter reported a best-ever profit of $100 million in the second quarter, following a loss of $116 million in the same quarter a year ago. It was the company’s third-consecutive quarterly profit after years of losses.

Twitter’s revenue grew 24 percent year-over-year, rising to $711 million for the quarter. Advertising revenue increased 23 percent to $601 million. Its data licensing and other revenue business increased its revenue by 29 percent.

Chief executive Jack Dorsey said on a conference call with analysts that the past quarter’s results reflect investments “in the long-term health” of Twitter. Those investments have included a crackdown on the bots and fake accounts that have proliferated on the platform, moves to curb abusive behavior, and better protection of the privacy of users. Dorsey said, “We’ll continue to invest heavily in making Twitter a healthier place because that’s the right thing to do.”

Twitter recently announced that it had removed more than 143,000 apps from its service after observing “malicious” activity from automated accounts. Twitter removed about 70 million accounts in May and June, but most of those had been inactive for more than 30 days, so not counted in its reported metrics for the quarter. Likewise, a most recent purge of fake accounts occurred after the close of the second quarter, so those numbers will be factored into the next earnings report.