added unit tests for global state