fixed so the underlying process is stopped when exiting