added onSelect event