added example for global state