added logger logic