better attribute detection