logger changes and mem leak fix