Resolve global state problem