adding detach function to job control