changed to stop if a child process got terminated by a signal, hopefully this will reduce the number of cases with weird return values when we have to terminate this program via ctl-c