Improve the validation of the customer and display flash message if errors