modified example to run detached job