fix occurrence marking after edits