changed alert to console.log