implemented onSelect