fix bugs and refactor AlertConfig