added update_attributes for atomic updating of attributes