serialize task with gob