try to terminate external process when quitting the program.