Finished event handler function