Created dynamic SetAttribs function