added snippet to manage child processes