add tests, clean up flash message