changed console.log into alert