added function getSelectedNames