controller modification for pagination