Modified for form validation