detects end of job before attempting to spool