add task function.