validation and flash message for question