fix bug in display_cost method