Adding state change detection to the unit store.