explicitly create data table and count to avoid refreshes causing out of memory problems