Improved error messages with flash