corrections to  terminate()