updated setStateChangedCallback bug