display errors before exit