fix wrong inc of total_pages method