added a error check for style changes in setAttributes