add task recovery with atomic count