added a counter to data getting