added selectionChanged event and getCurrentSelection function