The rally in the stock came despite a sharp fall in quarterly profitability