Second attempt at fixing onStateChange()