fix the count problem