fix bug (costM mi)