add spec test & edit flash alert