fix error message upon exit