added code for all processes to display when terminate
added code for check terminate