corrected bug and job counting