changed the way how we handle form validation