Fix to the too many pending jobs problem
Merge pull request #49 from lucacopa/thresholds_fix

Fix to the too many pending jobs problem