added the logic to select radio button