Add setAttr method for setting attributes and whitelisting them