Fix js alert bug