replaced window.alert() with console.log()