fix bug for last_page