fix sample with newer API