fixed logic error in chain breaking.