add attribute counting