fix for min_lenth and something for categories