exit smoothly with file
logging