Added support for form validation and errors via flash