logic cleaned in addStateInChain