update data method