Added cancelled job detection