aggregations: fix check for attribute type