code tweak for selection