Add stateChanged method for advice hooks