update displayData function