refactor the alert, fix rule bug