replacing TASKDATA.counter_add with APPDATA.counter_add