Use custom error class for form validation