How to update field value on every change of another field