fix email alert bug