Add state change callback.