Add validator for fields