updated to work with both element and attribute