fix bug out-of-index at last jobs

Don't queue new jobs when there's no new jobs available
Merge pull request #3 from WouterG/patch-1

Fix exception on the last few jobs - thanks @WouterG