Struggling retailer Bed Bath & Beyond has warded off bankruptcy after securing a $1 billion capital raise in an effort to revive the business.

The retailer offered convertible stock and warrants and received a $100 million additional credit line from one of its lenders, helping the company avoid a Chapter 11 bankruptcy filing, according to The Wall Street Journal.

The efforts will raise $225 million of equity capital, and the remaining funds will come over time, the outlet reported.

The announcement is timely for Bed Bath & Beyond, which warned on Monday that it would file for bankruptcy and see its assets liquidated if it did not complete fundraising, according to Bloomberg.

Bed Bath & Beyond has announced it will close 150 stores as part of its restructuring, according to CNN.

Bed Bath & Beyond stock has been on a rollercoaster ride this week, gaining 92% on Monday, but the company’s shares fell nearly 49% on Tuesday amid the capital raise announcement.

The retailer said it missed interest payments to bondholders last week, and its credit lines were frozen after breaching its debt agreements, The Wall Street Journal said.

The company said its comparable sales are expected to drop between 30% and 40% in the first quarter in a securities filing on Monday.

Bed Bath & Beyond said it expects to raise $225 million through selling convertible preferred shares and $800 million by issuing warrants that require holders to buy more preferred shares in the future, according to The Wall Street Journal.

Convertible stock helps investors limit losses by offering a guaranteed return and can provide a chance for gains once converted into common stock, said The Wall Street Journal.

If the company does end up filing for bankruptcy, its existing common stock and the new equity securities would likely be wiped out.

The funds from the proposed equity raise will go to paying down its bank credit lines, where it has $1.5 billion in credit lines with banks and lenders, according to the Monday filing. The new agreement with lenders will require Bed Bath & Beyond to pay its missed bond payments by March 3.

Sixth Street Partners, which gave the company a $375 million credit line last year, said it would expand the credit line by $100 million.

The company also announced the hiring of Holly Etlin as interim chief financial officer. Etlin was a partner at AlixPartners, a restructuring firm advising the company through its turnaround efforts.