add method for pagination