add click handler for selection