Oddly enough I was offline, working on a feature this morning that pulled some of this code out into a get_job_id() function. I'm not sure how it should be implemented now. Partly leaving this comment so I don't forget to re-examine that once I have real Internet access again.