throw an error if element is not present

Closes #175
Merge pull request #176 from frodsan/raise_if_el_is_null_or_undefined

throw an error if element is not present