Fix for pagination and searching