implement multiselect logic