fixing size check in attribute matrix