Fix JS error where wrong field name was expected