fixed a crash if no discounts were available