Fix bug of displaying wrong number of tasks in different pages.