code to update data