Fixed onselect condition