change console.debug to console.log