compensate for replacements between boundaries