fix validation bug, fix alert bug