Change myStateManager from reference to pointer to allow class copy.