Changed console.log to debug