Merge the selection changed handler