use debug instead of console.log