isSelected method added