fixes crash when nulls in count array