fixed selectDefined() selecting incorrect value