save and restore task data