refactor selectionEvent