fix cannot get word box in last page of a chapter

This should fix #644.