Added support for state changes