calling "exit" calls also the atexit functions!
FIXING issue #297