Handle state changes on example