updated paging logic
merge