Add a handler that's called on every state change