adding event for value changed