Added updatePagination method