refactored datachanged event