fixed the counting of problems