Updated beforechange to pass new value.