Addition of validation logic in `_setNewValue`.