after incorporating search and pagination