replace selectDefined with simpler boolean or