Added to program termination function