finally found a way for paginated search
fixed problems with paginated search