fix a small inconsistency in when to save the chain.