Not finding correct selection

@anmita yes that can be the reason. Use that variable.trim to remove the unwanted spaces and pass it to selector.

OptionSelected.trim The below post will help you.