make search box work with pagination