solve search and adding pagination