pulling atexit code