changed console to an alert.