Improved error and flash message