Fixes a bug in which it fails to select if there are multiple options with the same value