TEIIDDES-1840 fixed isValidSelection() logic