Listening to 'stateChange' event.