fixing a setAttributes crash