added safeguard against null jobs.