add task logic