add onSelect event.