updated to use custom logger instead of console.log