using debug instead console.log. fixes #4