Registering atexit shutdown message