Fix the example code of "Upload events when the application finishes"