better example for flash use with form validation