Fixed bug related to update_attributes