added a function to check if the job is cached.