better restore global state