added functionality for multiselect to support max select count