added logger and atexit