error checking if element does not exist