changes for pagination as commented