fix logic for min_counts