internal refactoring
throw an error if the element is not a select