added a counter to tasks