free resources on terminate and on exit