Add cost function variable to auto fits