added functionality for getting data of selected items