check if element passed to constructor is valid