Added a callback function to the example.