fix the issue of selected categories exceed the limit