fix bug in fc_cost