added function to select and deselect items