imporved logging