Added new events for state change and test.