How to select radio button if condition is met?