changed the statecontainer to delegate