updated method update to update_attributes to fix error