change debug to console.log