Validation and flash message