added afterselect handler