fix alert and valid