Fix error in attribute setting