changed console log to alert