better handling of child process errors. resolves #1