Added isSelected method.