track state changes