refactoring
safer implementation
add comment
Merge pull request #262 from crest-cassia/job_exceeds_max_num_jobs

Job exceeds max num jobs