fix a bug in the last frame of a section.