Added validation to the autoFields directive