End processing after processing the last sample