Update sample to avoid using deprecated/deleted API