check job exists before accessing it