fix buildAttributes()