fix paging functions.