maybe I don't understand everything here, but don't you want to kill the process also if you have `err` ?