fixed bug in chapter get_page_num