fprintf before exits