Fix to validate form fields