Added a an extra condition before the process termination msg is printed that checks if the child-process really is terminated (wait() also returns on status changes)