puts error before exiting