enabled logging, fixed application closing