fixed searching to allow for pagination