added pagination and loading to main search