replaced alert with console.log