Updated JS fix for onchange event