Implemented logic for multiple selection