update sample to show using custom callback