added global state reference as well as 'instance' to local_state