called when the program terminates normally