input validation with flash.