Putting back the old logic for getting selected  item