added check to compare element id or check element names