protect against nil cost_price