throw an error if provided element isn't an element