shared state working