Added code to allow switching selection using the dropdown