added atexit usage