adding logging functionality