chenged alert class to if statement