fix atexit declaration position