check if job is finished