fix bug when there is no data matches the search criteria