how to use if and alert together~