refactored flash error messages