Add code to prevent orphaned processes
Add signal trapping code