bug only closed cases need counting