add magic method call to set attributes on elements