serialize the task