fixed bug in max_categories validator