Fixing JS error on field edit screen