Small change to spark end listener