added logger function