added back in element name check but correctly