fix issue #115, use debug.log not console.log